I am trying to install pyodbc for a specific project, but unfortunately when I try to do an install, no matter the command I end up with the following error:
Command "/usr/local/bin/python3.5 -u -c "import setuptools,
tokenize;__file__='/tmp/pip-build-vw5rz5_t/pyodbc/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
.replace('\r\n', '\n'), __file__, 'exec'))" install --record
/tmp/pip-p5vfq2hq-record/install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in
/tmp/pip-build-vw5rz5_t/pyodbc/
Obviously, this error has already been reported here, and I am fully aware this is a python version dependency error. However I have attempted many different approaches to deal with this issue, including all the attempts in the Stack Overflow question, and the following:
Original attempt:
sudo pip3 install pyodbc
Installing in virtualenv (see here, and here)
Could anyone point me the correct way to install a python package that has a dependency on another python version than the default python package? I have another project that runs on python3.5 so I would prefer if I could do an install in the virtualenv.
Thanks for your help!
Following marctrem's excellent answer, and the clues left by Philippe Hebert, one can easily install unixodbc
with debian distributions using:
sudo apt-get install unixodbc-dev
sudo apt-get install unixodbc-bin
With these dependencies installed, the following works like a charm:
pip3 install pyodbc
This should work.
Clone, build and install!
$ git clone https://github.com/mkleehammer/pyodbc.git
$ python3 setup.py build
# python3 setup.py install
You might need unixodbc since it's a pyodbc dependency.
Have fun!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With