10000 Installation fails on OSX 10.11.2 · Issue #101 · mkleehammer/pyodbc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Installation fails on OSX 10.11.2 #101

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
rafales opened this issue Jan 28, 2016 · 11 comments
Closed

Installation fails on OSX 10.11.2 #101

rafales opened this issue Jan 28, 2016 · 11 comments

Comments

@rafales
Copy link
rafales commented Jan 28, 2016

Hi, I've been trying to install pyodbc on OSX 10.11.2. It's python 3.5 in virtualenv. Here's the output:

➜  ~  pip install pyodbc
Collecting pyodbc
  Using cached pyodbc-3.0.10.tar.gz
Building wheels for collected packages: pyodbc
  Running setup.py bdist_wheel for pyodbc ... error
  Complete output from command /Users/rafal/.virtualenvs/safari/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/tmplqchxhagpip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_ext
  building 'pyodbc' extension
  creating build
  creating build/temp.macosx-10.10-x86_64-3.5
  creating build/temp.macosx-10.10-x86_64-3.5/private
  creating build/temp.macosx-10.10-x86_64-3.5/private/var
  creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders
  creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt
  creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn
  creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T
  creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe
  creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc
  creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-error=unused-command-line-argument-hard-error-in-future -DPYODBC_VERSION=3.0.10 -DPYODBC_UNICODE_WIDTH=4 -UMAC_OS_X_VERSION_10_7 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c /private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src/buffer.cpp -o build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src/buffer.o -Wno-write-strings -Wno-deprecated-declarations
  warning: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Wunknown-warning-option]
  In file included from /private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src/buffer.cpp:12:
  /private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src/pyodbc.h:52:10: fatal error: 'sql.h' file not found
  #include <sql.h>
           ^
  1 warning and 1 error generated.
  error: command 'clang' 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 /Users/rafal/.virtualenvs/safari/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-r3c1ck3z-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rafal/.virtualenvs/safari/bin/../include/site/python3.5/pyodbc:
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    creating build
    creating build/temp.macosx-10.10-x86_64-3.5
    creating build/temp.macosx-10.10-x86_64-3.5/private
    creating build/temp.macosx-10.10-x86_64-3.5/private/var
    creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders
    creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt
    creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn
    creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T
    creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe
    creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc
    creating build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-error=unused-command-line-argument-hard-error-in-future -DPYODBC_VERSION=3.0.10 -DPYODBC_UNICODE_WIDTH=4 -UMAC_OS_X_VERSION_10_7 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c /private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src/buffer.cpp -o build/temp.macosx-10.10-x86_64-3.5/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src/buffer.o -Wno-write-strings -Wno-deprecated-declarations
    warning: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Wunknown-warning-option]
    In file included from /private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src/buffer.cpp:12:
    /private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/src/pyodbc.h:52:10: fatal error: 'sql.h' file not found
    #include <sql.h>
             ^
    1 warning and 1 error generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/Users/rafal/.virtualenvs/safari/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-r3c1ck3z-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rafal/.virtualenvs/safari/bin/../include/site/python3.5/pyodbc" failed with error code 1 in /private/var/folders/pt/t2v9lzls6xl_27skkvwcvsvh0000gn/T/pip-build-5k1e4xxe/pyodbc

I have unixodbc installed:

➜  /usr  sudo find . -name 'sql.h'
Password:
./local/Cellar/unixodbc/2.3.2_1/include/sql.h
./local/include/sql.h
@mkleehammer
Copy link
Owner

Fixed by bc1eec8. I accidentally put the wrong issue number in the commit.

@usr0418
Copy link
usr0418 commented Apr 21, 2016

@mkleehammer Hello, it seems the problem still occurred on my computer. I am using osx 10.11.4 and tried to install pyodbc in virtualenv with python3.5.1. Here is the output:

Collecting pyodbc
  Downloading pyodbc-3.0.10.tar.gz (68kB)
Installing collected packages: pyodbc
    Complete output from command /Users/usr0418/Projects/LAB/virtualenv_lab/vrlab2/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-du6wub4p-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/usr0418/Projects/LAB/virtualenv_lab/vrlab2/bin/../include/site/python3.5/pyodbc:
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    creating build
    creating build/temp.macosx-10.11-x86_64-3.5
    creating build/temp.macosx-10.11-x86_64-3.5/private
    creating build/temp.macosx-10.11-x86_64-3.5/private/var
    creating build/temp.macosx-10.11-x86_64-3.5/private/var/folders
    creating build/temp.macosx-10.11-x86_64-3.5/private/var/folders/bh
    creating build/temp.macosx-10.11-x86_64-3.5/private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn
    creating build/temp.macosx-10.11-x86_64-3.5/private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T
    creating build/temp.macosx-10.11-x86_64-3.5/private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy
    creating build/temp.macosx-10.11-x86_64-3.5/private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc
    creating build/temp.macosx-10.11-x86_64-3.5/private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-usr0418s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPYODBC_VERSION=3.0.10 -DPYODBC_UNICODE_WIDTH=4 -UMAC_OS_X_VERSION_10_7 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c /private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc/src/buffer.cpp -o build/temp.macosx-10.11-x86_64-3.5/private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc/src/buffer.o -Wno-write-strings -Wno-deprecated-declarations
    In file included from /private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc/src/buffer.cpp:12:
    /private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc/src/pyodbc.h:52:10: fatal error: 'sql.h' file not found
    #include <sql.h>
             ^
    1 error generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/Users/usr0418/Projects/LAB/virtualenv_lab/vrlab2/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-du6wub4p-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/usr0418/Projects/LAB/virtualenv_lab/vrlab2/bin/../include/site/python3.5/pyodbc" failed with error code 1 in /private/var/folders/bh/hxk6nx1n4vg8vljq7xv8slyw0000gn/T/pip-build-s1xoyqdy/pyodbc/

And I also have unixodbc installed:

/usr|⇒  sudo find . -name 'sql.h'
Password:
./local/Cellar/unixodbc/2.3.4/include/sql.h
./local/include/sql.h

@mkleehammer
Copy link
Owner

Unrelated FYI: mdfind -name is really fast on OS X.

The fix is on master, but I didn't make a release yet, so it would be version 3.11. I'll release now.

@mkleehammer
Copy link
Owner

Actually, it won't be right away because it doesn't build in 2.7. Something I've merged in didn't work right. I've tried using tox to test al 8000 l versions but need to push that too.

@usr0418
Copy link
usr0418 commented Apr 22, 2016

@mkleehammer I have tried mdfind -name and yes it is really fast!
Thank you for your explanation, I will wait for version 3.11.

@sgivens0
Copy link
Contributor
sgivens0 commented Aug 31, 2016

I'm also like this to be fixed! I'm in a slightly non standard homebrew setup because of ... enterprise... so my sql.h find results look at follows

~> find . -name 'sql.h'
$HOMEDIR/homebrew/Cellar/unixodbc/2.3.4/include/sql.h
$HOMEDIR/homebrew/include/sql.h

of course $HOMEDIR isn't the actual homedir :)

@sgivens0
Copy link
Contributor

its worth noting that this nonstandard path is the "default" install in user/home dir setup for mac homebrew

@ishepard
Copy link
ishepard commented Mar 24, 2017

I also have the same problem of @sgivens0 and I can not install it:

~/homebrew ~> find . -name 'sql.h'
/homebrew/Cellar/unixodbc/2.3.4/include/sql.h
/homebrew/include/sql.h

And the error is:

~> pip install pyodbc
Collecting pyodbc
  Using cached pyodbc-4.0.15.tar.gz
Building wheels for collected packages: pyodbc
  Running setup.py bdist_wheel for pyodbc ... error
  Complete output from command /Users/dspadini/homebrew/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7z/knc56ymj0n550l0_0r23jy9w0000m4/T/pip-build-SLvzsU/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 /var/folders/7z/knc56ymj0n550l0_0r23jy9w0000m4/T/tmpiohf_fpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_ext
  building 'pyodbc' extension
  creating build
  creating build/temp.macosx-10.11-x86_64-2.7
  creating build/temp.macosx-10.11-x86_64-2.7/src
  clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DPYODBC_VERSION=4.0.15 -UMAC_OS_X_VERSION_10_7 -I/usr/local/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/Users/dspadini/homebrew/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/buffer.cpp -o build/temp.macosx-10.11-x86_64-2.7/src/buffer.o -Wno-write-strings -Wno-deprecated-declarations
  In file included from src/buffer.cpp:12:
  src/pyodbc.h:56:10: fatal error: 'sql.h' file not found
  #include <sql.h>
           ^
  1 error generated.
  error: command 'clang' 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 /Users/dspadini/homebrew/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7z/knc56ymj0n550l0_0r23jy9w0000m4/T/pip-build-SLvzsU/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 /var/folders/7z/knc56ymj0n550l0_0r23jy9w0000m4/T/pip-CDVjUv-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'pyodbc' extension
    creating build
    creating build/temp.macosx-10.11-x86_64-2.7
    creating build/temp.macosx-10.11-x86_64-2.7/src
    clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DPYODBC_VERSION=4.0.15 -UMAC_OS_X_VERSION_10_7 -I/usr/local/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/Users/dspadini/homebrew/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/buffer.cpp -o build/temp.macosx-10.11-x86_64-2.7/src/buffer.o -Wno-write-strings -Wno-deprecated-declarations
    In file included from src/buffer.cpp:12:
    src/pyodbc.h:56:10: fatal error: 'sql.h' file not found
    #include <sql.h>
             ^
    1 error generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/Users/dspadini/homebrew/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7z/knc56ymj0n550l0_0r23jy9w0000m4/T/pip-build-SLvzsU/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 /var/folders/7z/knc56ymj0n550l0_0r23jy9w0000m4/T/pip-CDVjUv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/7z/knc56ymj0n550l0_0r23jy9w0000m4/T/pip-build-SLvzsU/pyodbc/

How can I solve this?

macOS El Capitan 10.11.6, Python 2.7.13

@ghost
Copy link
ghost commented Jun 19, 2017

If you have Homebrew, just install the ODBC headers:

$ brew install unixodbc

and run "pip install pyodbc" again.

@Nelkit
Copy link
Nelkit commented Jul 8, 2017

@Filipp good solution

If you have Homebrew, just install the ODBC headers:
$ brew install unixodbc
and run "pip install pyodbc" again.

@mkleehammer
Copy link
Owner

I agree with brew install, but I intended for the Python 2.7 binary wheel to install on El Capitan. I notice that all of the filenames have "macos_10_6" except for the Python 2.7 which says "macos_10_13". They literally use the same setup.py file - does anyone know why it does that? I haven't had time too look.

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

No branches or pull requests

6 participants
0