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?