Score:0

Installing pyobdc

ar flag

I'm trying to install pyodbc using pip3 but getting the below error:

[hvr@07EUW1HVRHAP02A ~]$ pip3 install pyodbc
Collecting pyodbc
  Using cached https://files.pythonhosted.org/packages/81/0d/bb08bb16c97765244791c73e49de9fd4c24bb3ef00313aed82e5640dee5d/pyodbc-4.0.30
.tar.gz
Installing collected packages: pyodbc
  Running setup.py install for pyodbc ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dp0ls1b2/pyodbc/setup.py'
;f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" insta
ll --record /tmp/pip-0dv3z9sq-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-s
trong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPYODBC_VERSION=4.0.30 -I/
usr/include/python3.6m -c src/buffer.cpp -o build/temp.linux-x86_64-3.6/src/buffer.o -Wno-write-strings -DHAVE_UNISTD_H -DHAVE_PWD_H -D
HAVE_SYS_TYPES_H -DHAVE_LONG_LONG -DSIZEOF_LONG_INT=8 -I/usr/include
    In file included from src/buffer.cpp:12:0:
    src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
     #include <sql.h>
                     ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
   
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dp0ls1b2/pyodbc/setup.py';f=getattr(tokenize, 'op
en', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-0dv
3z9sq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-dp0ls1b2/pyod
bc/
Martin avatar
kz flag
check this post: https://stackoverflow.com/questions/31353137/sql-h-not-found-when-installing-pyodbc-on-heroku - try to install ```unixodbc unixodbc-dev``` to get the missing header files...
Score:0
ng flag

This issue can be address by first installing ODBC libraries for UNIX by running following commands:

:~$ sudo apt install unixodbc-dev

:~$ pip install pyodbc

pugazhendhi avatar
ar flag
I have already installed unixodbc-dev in my server but still same error. I'm using pip3 install pyodbc and not pip. Any other packages to be installed or module paths to be modified
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.