install msodbcsql1 in databricks

Abhishek Gaikwad 191 Reputation points

I want to use databricks to run storedprocedure on Azure SQL database in PAAS. I have got the pyodbc library install on the databricks cluster. I am getting error ODB Driver 17 for SQL server : file not found.
when i run the below code to install the odbc driver I get the below error message .

curl | apt-key add -
curl > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get -q -y install msodbcsql17

Error Message :

Failed writing body
/bin/bash: line 1: /etc/apt/sources.list.d/mssql-release.list: Permission denied

Will the odbc driver wont be installed along with the pyodbc library.
Is their any other approach to install msodbcsql17

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,059 questions
{count} vote

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 84,941 Reputation points Microsoft Employee

    Hello @Abhishek Gaikwad ,

    Thanks for the question and using MS Q&A platform.

    As per the repro, by using the same code - I'm able to install the msodbcsql7 without any issues on Azure Databricks Runtime 9.0:


    Based on the Databricks Runtime, this could be a problem when you use sudo in this fashion, it won't work right. I would request you to try this command and see if it works.

     curl | apt-key add -  
     curl > /etc/apt/sources.list.d/mssql-release.list   
     apt-get update  
     ACCEPT_EULA=Y apt-get install msodbcsql17  


    For more details, refer to this question which addressing similar issue.

    Hope this will help. Please let us know if any further queries.


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators