I am attempting to use pyodbc to connect to a MSSQL database in python. I have installed the MS drivers following the instructions here using the 19.04 version. When attempting to install pyodbc via pip i get sql.h: No such file or directory
. Googling tells me I need to install unixodbc
and unixodbc-dev
, however when I try to do just that I get the following message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
unixodbc : Depends: odbcinst1debian2 (>= 2.3.7) but it is not going to be installed
Depends: libodbc1 (>= 2.3.7) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Running apt autoclean, apt install -f etc did not do anything.
It appears that there is a problem with the unixODBC that comes with the ODBC Driver on 19.10 (specifically one of the dependencies of the unixODBC that's provided with the driver depends on
multiarch-support
for some reason, which is present on all the other Ubuntus, but not on 19.10)To get around that you can either download the package from http://www.unixodbc.org/ (see download button on right) and follow the instructions to install it manually. Or install the default unixODBC that is in the Ubuntu repo by doing the following: