pyodbc on google colab

后端 未结 2 502
日久生厌
日久生厌 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:36

    I had the same problem, but finally figured out that installing the ODBC package direct from microsoft could solve it. Run the following code as a single batch in colab.

    %%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
    

提交回复
热议问题