When you will try to install the python pyodbc package with pip install pyodbc in Linux distribution you will get a very long list of errors, which end in
I will show you how to solve these errors in different os and in different ways for solve:
1. Ubuntu
On Ubuntu, you'll need to install unixodbc-dev:
sudo apt-get install unixodbc-dev
Install pip by using this command:
sudo apt-get install python3-pip
once that is installed, you should be able to install pyodbc successfully:
pip3 install pyodbc
2. Linux Debian Stretch
Adding one more answer on this question. For Linux Debian Stretch release you would need to install the following dependencies:
apt-get update
apt-get install unixodbc-dev
pip install pyodbc
3.Debian Slim
On Debian Slim some users mentioned they needed to add g++
apt-get update
apt-get install g++ unixodbc-dev
pip install pyodbc
5. Using conda
An easy way to install pyodbc is by using 'conda'. As conda automatically installs required dependencies including unixodbc.
conda --ugrade all
(optional)
then conda install pyodbc
it will install following packages:
libgfortran-ng: 7.2.0-hdf63c60_3 defaults mkl: 2018.0.3-1 defaults mkl_fft: 1.0.2-py36_0 conda-forge mkl_random: 1.0.1-py36_0 conda-forge numpy-base: 1.14.5-py36hdbf6ddf_0 defaults pyodbc: 4.0.17-py36_0 conda-forge unixodbc: 2.3.4-1 conda-forge
6.CentOS
I had the same problem on CentOS 5.5
In addition to installing unixODBC-devel I also had to install gcc-c++
yum install gcc-c++
Edwinroast
Nov. 20, 2023, 4:06 p.m. Reply