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

 

hosenmdaltaf

Hosen MD Altaf

Hello! I'm Hosen MD Altaf, a passionate Software Engineer and content writer.Who's experienced in taking fullstack applications from scratch to production.Currently, I am working with python and javaScript based FullStack Web development. Over the last 2 years, I've had the opportunity to develop web applications for a handful of awesome companies / clients as a consultant and continue to do so today. My work includes developing fullstack web apps, creating backend servers,designing font-end application, small Big-data and data science projects,creating websites with python django,react.js and wordpress.I am eager to learn kew technologies and looking for new opportunitys.

Comments (2)

wave

Leave Comment

wave