Databricks App Error libodbc.so.2: cannot open shared object file: No such file or directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
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
- Labels:
-
Spark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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!

