Pip Install Pyodbc Failed Error: Failed Building Wheel for Pyodbc

I'am trying to import pyodbc library into google colab, but i'am getting this error.

Just in case, I have Anaconda installed in my notebook, and I never had problem with pyodbc in there.

Can you help me please?

Tks!

Collecting pyodbc
  Using cached 
Building wheels for collected packages: pyodbc
  Building wheel for pyodbc (setup.py) ... error
  ERROR: Failed building wheel for pyodbc
  Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc
    Running setup.py install for pyodbc ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u5dmb223/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u5dmb223/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9jmhckrt/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
7

You can try the following:

!apt install unixodbc-dev
!pip install pyodbc
0

While installing 'unixodbc-dev' it will ask for permission to install all dependent required libraries. Follow the steps to install pyodbc:

!apt install unixodbc-dev --yes
!pip install pyodbc

Follow this one:

!apt install unixodbc-dev --yes
!pip install pyodbc

Giving permission while installing unixodbc-dev to install if anything required.

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest