โ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
Passionate about hosting events and connecting people? Help us grow a vibrant local communityโsign up today to get started!
Sign Up Now