我有一个 python 轮子上传到安装在 databricks 服务中的 azure 存储帐户。我正在尝试使用集群初始化脚本来安装轮子,如 databricks documentation 中所述。 。
我的存储确实已安装,并且我的文件路径对我来说看起来是正确的。在笔记本中运行命令 display(dbutils.fs.ls("/mnt/package-source"))
会产生结果:
path: dbfs:/mnt/package-source/parser-3.0-py3-none-any.whl
name: parser-3.0-py3-none-any.whl
我尝试使用以下命令从集群初始化文件安装轮子:
/databricks/python/bin/pip install "dbfs:/mnt/package-source/parser-3.0-py3-none-any.whl"
但是集群启动失败。它的日志给我一个错误,说它找不到该文件:
WARNING: Requirement 'dbfs:/mnt/package-source/parser-3.0-py3-none-any.whl' looks like a filename, but the file does not exist
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/dbfs:/mnt/package-source/parser-3.0-py3-none-any.whl'
我也试过这样:
/databricks/python/bin/pip install /mnt/package-source/parser-3.0-py3-none-any.whl
但我遇到了类似的错误:
WARNING: Requirement '/mnt/package-source/parser-3.0-py3-none-any.whl' looks like a filename, but the file does not exist
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/mnt/package-source/parser-3.0-py3-none-any.whl'
我什至尝试使用相对路径,例如 ../../mnt/package-source/...
但无济于事。谁能告诉我我做错了什么?
相关问题:Azure Databricks cluster init script - install python wheel
最佳答案
我使用相对路径让它工作。事实证明 ../../mnt/
不是正确的路径。它使用 ../../../dbfs/mnt/
工作。只需使用 bash ls 命令探索一下文件系统即可找到它。
对于遇到同样问题的其他人,我建议从笔记本中的类似内容开始:
%%sh
ls ../../../
关于Azure Databricks 群集初始化脚本 - 从已安装的存储安装wheel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61080018/