โ11-29-2022 06:08 AM
I have installed the library via PyPI on the cluster. When we import the package on notebook, getting the following error
import librosa
OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
โ11-29-2022 08:20 AM
it seems the linux OS is missing the libsndfile package.
This is apparently a dependency of librosa.
This can be done by using an init script:
https://docs.databricks.com/clusters/init-scripts.html#cluster-scoped-init-scripts
โ11-29-2022 08:20 AM
it seems the linux OS is missing the libsndfile package.
This is apparently a dependency of librosa.
This can be done by using an init script:
https://docs.databricks.com/clusters/init-scripts.html#cluster-scoped-init-scripts
โ11-29-2022 08:25 AM
Thank you werners. Just figured that out and had an init script to sort out the issue. Below steps helped me to solve the issue.
dbutils.fs.mkdirs("dbfs:/cluster-init/scripts/")
dbutils.fs.put("/cluster-init/scripts/libsndfile-install.sh","""
#!/bin/bash
apt-get --yes install libsndfile1
""", True)
and added init script for the cluster as
dbfs:/cluster-init/scripts/libsndfile-install.sh
โ07-19-2024 07:01 AM - edited โ07-19-2024 07:02 AM
If anybody ends up here after 2024: the init file must now be placed in the workspace for the cluster to accept it.
So in Workspace, use Create/File to create the init script.
Then add it to the cluster config in
Compute - Your cluster - Advanced Config - init scripts
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group