cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Databricks App Error libodbc.so.2: cannot open shared object file: No such file or directory

SObiero
New Contributor

How do I solve this error in my Databricks Apps when using the pyodbc library? I have used an init script to install the library in my cluster, which has resolved the issue in Notebooks. However, the problem persists in Apps. I have used the following commands in my init script:
sudo apt-get update
sudo apt-get install -y libodbc2
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18

 

2 REPLIES 2

Brahmareddy
Honored Contributor

Hi,

How are you doing today?, As per my understanding, It looks like your init script is correctly installing the ODBC driver for Notebooks, but Apps might not be picking it up because they run in a different context. Have you checked if the Apps are using the same cluster and environment? Sometimes, environment variables or library paths donโ€™t carry over. You could try explicitly setting the LD_LIBRARY_PATH in your init script to make sure the driver is linked properly. Also, running print(pyodbc.drivers()) inside an App can help confirm if the driver is available. If itโ€™s missing, you might need to check permissions or try a different installation approach. Let me know what you find!

Regards,

Brahma

mourinseoexpart
Visitor

Your analysis is spot on! The issue likely stems from environment differences between Notebooks and Apps. Checking cluster consistency, verifying and setting should help. Also, reviewing permissions and alternative installations might be necessary. Let me know what you findโ€”Iโ€™d be happy to troubleshoot further!

Connect with Databricks Users in Your Area

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