Python Databricks群集未初始化Azure库,错误为:模块';lib';没有属性';SSL_ST_INIT';
我正在使用Azure DataBricks笔记本和Azure库来获取Blob存储中的文件列表。已计划此任务,并在完成作业后终止群集,然后使用新运行重新启动 我正在使用Azure 4.0.0库() 有时我会收到错误消息:Python Databricks群集未初始化Azure库,错误为:模块';lib';没有属性';SSL_ST_INIT';,python,azure,pyspark,openssl,databricks,Python,Azure,Pyspark,Openssl,Databricks,我正在使用Azure DataBricks笔记本和Azure库来获取Blob存储中的文件列表。已计划此任务,并在完成作业后终止群集,然后使用新运行重新启动 我正在使用Azure 4.0.0库() 有时我会收到错误消息: AttributeError:模块“lib”没有属性“SSL\u ST\u INIT” 而且很少: AttributeError:cffi库“\u openssl”没有函数、常量或 名为“CRYPTOGRAPHY\u PACKAGE\u VERSION”的全局变量 我找到
- AttributeError:模块“lib”没有属性“SSL\u ST\u INIT”
- AttributeError:cffi库“\u openssl”没有函数、常量或 名为“CRYPTOGRAPHY\u PACKAGE\u VERSION”的全局变量
import pandas as pd
import re
import os
from pyspark.sql.types import *
import azure
from azure.storage.blob import BlockBlobService
import datetime
import time
r = []
marker = None
blobService = BlockBlobService(accountName,accountKey)
while True:
result = blobService.list_blobs(sourceStorageContainer, prefix = inputFolder, marker=marker)
for b in result.items:
r.append(b.name)
if result.next_marker:
marker = result.next_marker
else:
break
print(r)
谢谢解决此问题的方法是将Azure library降级为3.0.0
Azure v4似乎与DataRicks中的一些初始库存在冲突。此问题也与pyOpenSSL包有链接。降级到18.0.0版对我来说是个好办法。我在集群初始化时使用了下面的脚本作为初始化脚本
dbutils.fs.put("/databricks/script/pyOpenSSL-install.sh","""
#!/bin/bash
/databricks/python/bin/pip uninstall pyOpenSSL -y
/databricks/python/bin/pip install pyOpenSSL==18.0.0
""", True)
运行databricks runtime 6或更高版本现在应该可以解决这个问题 请发布关于您的解决方案或解决问题的步骤的答案,这将帮助其他遇到类似问题的人。谢谢。这解决了我的问题。。但是,我没有降级,而是将其升级到19.0.0版。而出现问题的包(
azure存储blob
12.2.0)。以下是我如何做到这一点的详细信息: