cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in importing librosa library while using databricks runtime engine 11.2

Chandru
New Contributor II

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

1 ACCEPTED SOLUTION

Accepted Solutions

-werners-
Esteemed Contributor III

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

View solution in original post

2 REPLIES 2

-werners-
Esteemed Contributor III

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

Chandru
New Contributor II

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

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.