10 hours ago
I have to install some custom library in a Python Databricks App. According to the documentation this should be possible through UC volumes:
https://docs.databricks.com/aws/en/dev-tools/databricks-apps/dependencies#install-wheel-files-from-u...
However, the volume is never mounted inside the app:
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/Volumes/catalog/schema/volume/package_name-1.0.0-py3-none-any.whl'
Listing the root directory in the app (ls /) and showing the result with streamlit confirms that there is no directory /Volume in the app.
Is there any other way to install an app dependency without having to copy the source code or wheel into the app code?
Does anyone have any idea how to get my package installed in the app? Setting up a private repository to point pip to is not an option in this scenario.
Thanks, Nico
9 hours ago
I have confirmed that the app's service principal has READ access to the volume, the whl is readable through the SDK and the app has a ressource UC volume that is referenced in app.yml and available as an env var within the app.
According to the documentation that should be all prerequisites and the installation should work:
https://docs.databricks.com/aws/en/dev-tools/databricks-apps/dependencies#install-wheel-files-from-u...
9 hours ago
Hi @nk-five1 ,
This is a known issue. It seems that UC volumes are not mounted and you cannot access them using python os module. You can read more at below thread:
The workaround for now is to use python SDK
5 hours ago
Thank you. So I guess the workaround is to pull the .whl into the app using the SDK, install it manually and only then start the actual entrypoint. Very tedious and error prone. That even makes duplicating the dependency code into the app seem like a not-so-bad alternative 😄
5 hours ago
I hope that in near future they add possibility to access volumes using plain python os module. Because as of now interacting with volumes from databricks apps is quite cumbersome
an hour ago
The app can’t see /Volumes because the Unity Catalog volume isn’t added as an app resource and referenced via environment variables, which is required for Databricks Apps. you must add the UC volume as an app resource and reference it using valueFrom in app.yaml. Hardcoding /Volumes/... in requirements won’t work until the resource is added and permissions are granted to the app’s service principal.
The documented flow for installing wheels in Apps is: upload the wheel to a UC volume, add that volume as an app resource, bind it to an env var with valueFrom, and reference that env var in requirements.txt rather than using a literal /Volumes/... path.
Ref Doc - https://docs.databricks.com/aws/en/dev-tools/databricks-apps/dependencies#install-wheel-files-from-u...
Ref Doc - https://docs.databricks.com/aws/en/dev-tools/databricks-apps/uc-volumes
59m ago
Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!
Sign Up Now