Azure Databricks 集群初始化脚本 - 从安装的存储安装 wheel

Azure Databricks cluster init script - Install wheel from mounted storage

我有一个 python 轮上传到一个安装在数据块服务中的 azure 存储帐户。我正在尝试使用数据块 documentation 中描述的集群初始化脚本来安装 wheel。

我的存储肯定是挂载的,我的文件路径看起来是正确的。 运行 笔记本中的命令 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

我尝试使用此命令从集群初始化文件安装 wheel:

/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/... 等相对路径,但无济于事。谁能告诉我我做错了什么?

相关问题:

我使用相对路径让它工作。事实证明 ../../mnt/ 不是正确的路径。它使用 ../../../dbfs/mnt/ 工作。只需使用 bash ls 命令探索文件系统即可找到它。

对于遇到同样问题的任何其他人,我建议从笔记本中的类似内容开始:

%%sh
ls ../../../