我正在关注这个问题的答案Load file from Azure Files to Azure Databricks使用以下代码创建 SAS token
# Create a client of Azure File Service as same as yours
from azure.storage.file import FileService
account_name = '<your account name>'
account_key = '<your account key>'
share_name = 'test'
directory_name = None
file_name = 'test.xlsx'
file_service = FileService(account_name=account_name, account_key=account_key)
但我收到错误:
ModuleNotFoundError: No module named 'azure.storage'
我已经使用这些命令安装了模块
!pip install azure
!pip install azure-storage
!pip install azure-storage-file
之前的尝试都无法修复我的“ModuleNotFoundError:没有名为“azure.storage”的模块”
最佳答案
此类位于另一个包中:azure.storage.file.fileservice
( doc ),因此您需要编写:
from azure.storage.file.fileservice import FileService
关于python - Databricks:没有名为 azure.storage 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73380200/