Azure Databricks cluster init script - Install wheel from mounted storage

吃可爱长大的小学妹 提交于 2020-04-18 04:00:51

问题


I have a python wheel uploaded to an azure storage account that is mounted in a databricks service. I'm trying to install the wheel using a cluster init script as described in the databricks documentation.

My storage is definitely mounted and my file path looks correct to me. Running the command display(dbutils.fs.ls("/mnt/package-source")) in a notebook yields the result:

path: dbfs:/mnt/package-source/parser-3.0-py3-none-any.whl
name: parser-3.0-py3-none-any.whl

I have tried to install the wheel from a cluster init file using this command:

/databricks/python/bin/pip install "dbfs:/mnt/package-source/parser-3.0-py3-none-any.whl"

but the cluster fails to start. It's logs give me an error saying it can't find the file:

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'

I have also tried it this way:

/databricks/python/bin/pip install /mnt/package-source/parser-3.0-py3-none-any.whl

but I get a similar error:

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'

I've even tried using relative paths such as ../../mnt/package-source/... but to no avail. Can anyone tell me what I'm doing wrong please?

Related question: Azure Databricks cluster init script - install python wheel


回答1:


I got it working using a relative path. It turns out ../../mnt/ wasn't the correct path. It worked using ../../../dbfs/mnt/. It just took a bit of exploring the file system using the bash ls command to find it.

For anyone else experiencing the same problem, I suggest starting with something like this in a notebook:

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


来源:https://stackoverflow.com/questions/61080018/azure-databricks-cluster-init-script-install-wheel-from-mounted-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!