Skip to content

"make" failing when building pyodbc #185

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

Closed
Ledmington opened this issue Mar 16, 2022 · 2 comments
Closed

"make" failing when building pyodbc #185

Ledmington opened this issue Mar 16, 2022 · 2 comments

Comments

@Ledmington
Copy link

Ledmington commented Mar 16, 2022

I started messing around with the code of this repo to try to help but unfortunately i can't get it to compile.
I simply run make on the project's root directory and this error showed up when pip was trying to install pyodbc:

    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0dutdqb7/pyodbc_2e52b6ae1e7645ee9b8cfe6d5bf51ae2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0dutdqb7/pyodbc_2e52b6ae1e7645ee9b8cfe6d5bf51ae2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-6ukd3k82/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pyodbc
         cwd: /tmp/pip-install-0dutdqb7/pyodbc_2e52b6ae1e7645ee9b8cfe6d5bf51ae2/
    Complete output (16 lines):
    /usr/local/lib/python3.8/site-packages/setuptools/dist.py:697: UserWarning: Usage of dash-separated 'library-dirs' will not be supported in future versions. Please use the underscore name 'library_dirs' instead
      warnings.warn(
    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.30 -I/usr/local/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: No such file or directory
       56 | #include <sql.h>
          |          ^~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0dutdqb7/pyodbc_2e52b6ae1e7645ee9b8cfe6d5bf51ae2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0dutdqb7/pyodbc_2e52b6ae1e7645ee9b8cfe6d5bf51ae2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-6ukd3k82/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pyodbc Check the logs for full command output.
WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
@Ledmington
Copy link
Author

After some trial and error i found that i need to add these lines in the Dockerfile, present in the project's root directory, in order to install the library sql.h.

RUN apt update -y
RUN apt install unixodbc-dev -y

@yakimka
Copy link
Collaborator

yakimka commented Mar 27, 2022

Fixed by #136

@yakimka yakimka closed this as completed Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants