Pyodbc installation error on Ubuntu 16.04 with Sql Server installed

后端 未结 2 766
感动是毒
感动是毒 2021-02-06 08:11

I am trying to test my scripts for data migration from mssql-server to oracle server. For this, I have to install pyodbc python

相关标签:
2条回答
  • 2021-02-06 08:26

    I do not have Sql server installed but when I want to install pyodbc at new machine, I can't install it as well. Someone suggest the following (I can't exactly tell where I find it):

    sudo apt-get install unixodbc-dev
    sudo pip install pyodbc
    
    0 讨论(0)
  • 2021-02-06 08:37

    Finally, I've got the solution from Microsoft's website only. Here is the method for setting up unixodbc with mssql on Ubuntu 16.04:

    sudo apt-get install unixodbc-dev-utf16
    

    After this, I can easily install pyodbc with:

    pip install pyodbc
    

    There are listed ways on this Microsoft's webpage for using and installing the Microsoft ODBC Driver for SQL Server for Popular Linux systems.


    Here is the easiest installation method for on Ubuntu 16.04 that I've found:

    sudo su
    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
    exit
    sudo apt-get update
    sudo ACCEPT_EULA=Y apt-get install msodbcsql mssql-tools
    sudo apt-get install unixodbc-dev-utf16 #this step is optional but recommended*
    
    0 讨论(0)
提交回复
热议问题