Tuesday, February 18, 2020

Re: pyodbc in umbutu 19.10

There may be development libraries missing. An internet search found this:  

sudo apt install unixodbc-dev

Hope it helps!

-Jorge



On Tue, Feb 18, 2020, 10:49 AM Elias Coutinho <coutinho.elias@gmail.com> wrote:
Good afternoon people.


Out of curiosity I installed SQL Server on Linux.


I restored a database and made basic commands. Working properly!



I have a connection I made to a .py file to make queries and run stored procedures. It also works on windows.



As I wanted to have a SQL Server SGDB and I didn't want a virtual machine, it was setting up an optimal environment.

but when running my .py file I missed pyodbc and when installing it returned an error and does not install.



Below the log, something caught my attention, I highlighted it in bold:



elias @ eliasPai: ~ $ pip3 install pyodbc
Collecting pyodbc
Using cached pyodbc-4.0.28.tar.gz (264 kB)
Installing collected packages: pyodbc
Running setup.py install for pyodbc… error
ERROR: Command errored out with exit status 1:
command: /home/elias/.pyenv/versions/3.8.1/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv [0] = '" '" '/tmp/pip-install-07bga8vp/pyodbc/setup.py' "' "'; file = '"'" '/ tmp / pip-install-07bga8vp / 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-2nc3ppfp/install-record.txt --single-version-externally-managed --compile - install-headers /home/elias/.pyenv/versions/3.8.1/include/python3.8/pyodbc
cwd: / tmp / pip-install-07bga8vp / pyodbc /
Complete output (14 lines):
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build / temp.linux-x86_64-3.8
creating build / temp.linux-x86_64-3.8 / src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION = 4.0.28 -I / home / elias / .pyenv / versions / 3.8.1 / include / python3 .8 -c src / buffer.cpp -o build / temp.linux-x86_64-3.8 / src / buffer.o -Wno-write-strings
In file included from src / buffer.cpp: 12:
src / pyodbc.h: 56: 10: fatal error: sql.h: File or directory does not exist
56 | #include <sql.h>
** | ^ ~~~~~~ **
** compilation terminated. **
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/elias/.pyenv/versions/3.8.1/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv [0] = '" '" '/tmp/pip-install-07bga8vp/pyodbc/setup.py' "' "'; file = '"'" '/ tmp / pip-install-07bga8vp / 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-2nc3ppfp/install-record.txt --single-version-externally-managed --compile - install-headers /home/elias/.pyenv/versions/3.8.1/include/python3.8/pyodbc Check the logs for full command output.





Then I tried to install several times using:
python3 -m pip install --upgrade pip
pip3 install setuptools
pip install --upgrade setuptools

Does anyone have a tip?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7b007da3-4721-434a-8710-e2a4e8b526b5%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANfN%3DK8ZVZBFK15UnJdZ9L1whFrLHXv%2BuSJgBWP8XKuXL1SXhA%40mail.gmail.com.

No comments:

Post a Comment