pyodbc on google colab

后端 未结 2 499
日久生厌
日久生厌 2021-01-24 22:43

I am trying to connect to my SQL server on google colab by using pyodbc. However, it tells me that I cannot find the driver.

Code to install packages (I replaced IP, por

2条回答
  •  深忆病人
    2021-01-24 23:38

    Thanks both of you, this worked for me:

    %%sh
    curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
    curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
    sudo apt-get update
    sudo ACCEPT_EULA=Y apt-get -q -y install msodbcsql17
    !sudo apt-get install unixodbc-dev
    !pip install pyodbc
    !pip install chart_studio
    
    import pyodbc
    

提交回复
热议问题