-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip install pyodbc failing: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 #276
Comments
Your machine does not have the ODBC header files installed. You need to do
and then try installing pyodbc again. |
Hi, I already have
And I'm trying to install the latest
I'm using:
Let me know if I need to install any other dependencies. |
Anyway, I figured out the issue. I had to install In case anybody runs into this issue again. Please ensure you've installed these:
FYI: Python 2.x users, will need |
I'm see the same issue and both python3-dev and unixodbc-dev are installed. Python 3.6.4
|
Strange. I exactly had same issue.
But after installing Can you make sure you have all these dev packages installed on your system? Not sure if this works, but these include pretty much all the dependencies usually required for python.
|
@neostorm - How did you install Python 3.6 on that machine? |
RHEL / CentOS:
|
using alpine?? |
for python3.7 run also: |
Thanks, It worked. |
I have the same issue in Visual Studio Code on Mac OSX while trying to deploy a timer trigger function to Azure Functions. The function works perfectly while executing within VSC, but the deployment fails with the same 'unable to execute gcc' error. I found another issue talking about that, where I've asked for help too, but if anyone watching this issue can help me, I'd be very grateful! |
@dxkaufman what you're describing has nothing to do with pyODBC, and that error message is very generic, so it is no surprise you will find issues about it which are completely unrelated to your situation. |
@v-chojas For that matter, I seem to have read this post inattentively... I thought it mentioned the gcc error, but now I realize this one has more to do with the presence of code files... my mistake. Thanks for the quick reply. |
Might just come down to the version of Python one is using. I was using python 3.6 on ubuntu 14.04, so
Worked for me. |
worked for me on ubuntu 14.04. thanks |
@ffedoroff thanks bro, it worked |
Perfectly solved my problem. |
on ubuntu 18.04 and python3.7, python3.7 dev was required for me:
|
On ubuntu 16.04 and using python3.6 I am still getting the error.
After doing research on it, I found that we could add python3.6-dev package using the following repo: But does adding this repo trustworthy? |
deadsnakes has been around for a long time and I've never seen anyone suggest that it is not trustworthy. However, the ultimate decision of whether or not to trust a third-party repo is up to you. |
This worked for me: sudo apt-get install python3.8-dev |
Hi, FROM python:3.7-slim RUN mkdir /app COPY requirements.txt ./ EXPOSE 8080
|
That looks like Linux, not Windows; and the solution is to install |
This issue is happening when we try to install pyodbc in virtual environment. |
If you are using Python 3, make sure that you are not running the installation in Python 2. |
i am getting same error. i have installed all when i install pyodbc i used pip3 , as pip is not available on my machine. but still error as below on python.h ... any help here. Failed building wheel for pyodbc |
un crack, esto me soluciono, todo empezó al utilizar mal un comando remove, tengan cuidado! ahahah |
You have to update your python repository by installing yum install python3-devel |
bloody hell, this was required yum install python3-devel |
This helped me from doccuments site: sudo apt install python3-pip I just didn't use --user because of ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv. |
I solved it by using this command and then install pyodbc ! apt install unixodbc-dev -y |
Install pyodbc on Centos / RHELWhy PyODBC is needed? To connect to any Database via Python. (There are specific drivers available for each database, pyodbc serves as a common library) These are must have libraries for any development work, so its better to have them installed as part of any CentOS / RHEL setup. $ sudo yum install unixodbc-dev
$ sudo yum install unixODBC unixODBC-devel
$ sudo yum install epel-release$ sudo yum install gcc-c++ These are specific to Python ODBC. $ pip3 --version
$ sudo yum install python3-devel
$ sudo pip3 install pyodbc The installation can be tested as follows $ python3
>>> import pyodbc If no errors are thrown, then your installation is perfect. |
Ubuntu 20.04
|
There is no point in bumping this issue - please read the documentation: https://github.com/mkleehammer/pyodbc/wiki/Install |
worked for me |
Had the same problem running |
Fix for Ubuntu 20.04 running Python3.8
|
this works. thank you |
Please first make sure you have looked at:
Environment
To diagnose, we usually need to know the following, including version numbers. On Windows, be
sure to specify 32-bit Python or 64-bit:
Issue
pip install pyodbc --user
Collecting pyodbc
Using cached pyodbc-4.0.17.tar.gz
Building wheels for collected packages: pyodbc
Running setup.py bdist_wheel for pyodbc ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-YtLrrj/pyodbc/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmp5eqhA5pip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPYODBC_VERSION=4.0.17 -DSQL_WCHART_CONVERT=1 -I/usr/include/python2.7 -c src/textenc.cpp -o build/temp.linux-x86_64-2.7/src/textenc.o -Wno-write-strings
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from src/textenc.cpp:2:0:
src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
#include <sql.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Failed building wheel for pyodbc
Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-YtLrrj/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-CRLrEJ-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPYODBC_VERSION=4.0.17 -DSQL_WCHART_CONVERT=1 -I/usr/include/python2.7 -c src/textenc.cpp -o build/temp.linux-x86_64-2.7/src/textenc.o -Wno-write-strings
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from src/textenc.cpp:2:0:
src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
#include <sql.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-YtLrrj/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-CRLrEJ-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-YtLrrj/pyodbc/
The text was updated successfully, but these errors were encountered: