I am running Linux (2.6.18-164.15.1.el5.centos.plus) and trying to install pyodbc. I am doing pip install pyodbc and get a very long list of errors, which end in
I faced with same issue. For python3.6.8 and ubuntu 16.04 none of above did not help me.
sudo apt-get install python3.6-dev
This solved my problem.
Struggled with the same issue
After running:
sudo apt-get install unixodbc-dev
I was able to pip install pyodbc
I have referenced this question several times, and gone on to actually find the answer I was looking for here: pyodbc wiki
To avoid gcc error on Ubuntu Linux, I did:
sudo aptitude install g++
I also installed the following 2 packages from Synaptic:
python-dev
tdsodbc
For archlinux/manjaro:
sudo pacman -S unixodbc
then:
sudo pip install pyodbc
or:
pip install pyodbc
You can upgrade your pip wheel setuptools before installing pyodbc (it won't affect the pyodbc installation) also with:
sudo python -m pip install --upgrade pip wheel setuptools
or
python -m pip install --upgrade pip wheel setuptools
A 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
In my case (Amazon Linux AMI) none of the above worked. The following worked (idea from here):
cc1plus
. For me it was in /usr/libexec/gcc/x86_64-amazon-linux/4.8.5/cc1plus
. For you it may vary a bit. Try ls -l /usr/libexec/gcc
to find the proper directory name and go ahead.echo $PATH
(for me it was /sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin
)cc1plus
in one of the directories in your PATH: sudo ln -s /PATH/TO/cc1plus /DIRinPATH/
sudo ln -s /usr/libexec/gcc/x86_64-amazon-linux/4.8.5/cc1plus /usr/bin/