Python ODBC setup on CentOS 7
Necessary packages
- unixODBC and unixODBC-devel
sudo yum install unixODBC unixODBC-devel
- gcc-c++
sudo yum install gcc-c++
- pyodbc
sudo yum install epel-release python3-pip python3-devel
sudo pip3 install pyodbc
- Latest version is installed
- RedHat Enterprise Server 7
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo
- Install the package
sudo ACCEPT_EULA=Y yum install msodbcsql17
Configurations
#vim /etc/odbcinst.ini
[ODBC Driver 17 for SQL Server]
Description=ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.6.so.1.1
UsageCount=1
- Test it with your python script!
Comments
Post a Comment
Please give your review or ask question ?