Skip to content

Pip install fails on OS X Mojave #15

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
sarahdavis23 opened this issue Dec 17, 2018 · 10 comments
Closed

Pip install fails on OS X Mojave #15

sarahdavis23 opened this issue Dec 17, 2018 · 10 comments

Comments

@sarahdavis23
Copy link

I've been trying to install version 0.2.1 on Mojave but it's somehow unhappy with gcc. I installed anaconda and I've tried both in the base environment and created another virtual environment. The error message is below. I get a similar message if I don't specify a version.

I've done the things suggested in this link but it doesn't seem to help: https://stackoverflow.com/questions/52509602/cant-compile-c-program-on-a-mac-after-upgrade-to-mojave

Maybe this is relevant: hkwi/python-geohash#27

pip install thrift_sasl==0.2.1
Collecting thrift_sasl==0.2.1
Collecting thriftpy (from thrift_sasl==0.2.1)
Collecting sasl>=0.2.1 (from thrift_sasl==0.2.1)
Using cached https://files.pythonhosted.org/packages/8e/2c/45dae93d666aea8492678499e0999269b4e55f1829b1e4de5b8204706ad9/sasl-0.2.1.tar.gz
Collecting ply<4.0,>=3.4 (from thriftpy->thrift_sasl==0.2.1)
Using cached https://files.pythonhosted.org/packages/a3/58/35da89ee790598a0700ea49b2a66594140f44dec458c07e8e3d4979137fc/ply-3.11-py2.py3-none-any.whl
Requirement already satisfied: six in /anaconda3/envs/py36/lib/python3.6/site-packages (from sasl>=0.2.1->thrift_sasl==0.2.1) (1.12.0)
Building wheels for collected packages: sasl
Running setup.py bdist_wheel for sasl ... error
Complete output from command /anaconda3/envs/py36/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/1p/xb7bs_j111x1pxh7km__3dx80000gp/T/pip-install-0j2takk9/sasl/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 /private/var/folders/1p/xb7bs_j111x1pxh7km__3dx80000gp/T/pip-wheel-1nmq5k21 --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/sasl
copying sasl/init.py -> build/lib.macosx-10.7-x86_64-3.6/sasl
running egg_info
writing sasl.egg-info/PKG-INFO
writing dependency_links to sasl.egg-info/dependency_links.txt
writing requirements to sasl.egg-info/requires.txt
writing top-level names to sasl.egg-info/top_level.txt
reading manifest file 'sasl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sasl.egg-info/SOURCES.txt'
copying sasl/saslwrapper.cpp -> build/lib.macosx-10.7-x86_64-3.6/sasl
copying sasl/saslwrapper.h -> build/lib.macosx-10.7-x86_64-3.6/sasl
copying sasl/saslwrapper.pyx -> build/lib.macosx-10.7-x86_64-3.6/sasl
running build_ext
building 'sasl.saslwrapper' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/sasl
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/envs/py36/include -arch x86_64 -I/anaconda3/envs/py36/include -arch x86_64 -Isasl -I/anaconda3/envs/py36/include/python3.6m -c sasl/saslwrapper.cpp -o build/temp.macosx-10.7-x86_64-3.6/sasl/saslwrapper.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
sasl/saslwrapper.cpp:249:10: fatal error: 'string' file not found
#include
^~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1


Failed building wheel for sasl
Running setup.py clean for sasl
Failed to build sasl
Installing collected packages: ply, thriftpy, sasl, thrift-sasl
Running setup.py install for sasl ... error
Complete output from command /anaconda3/envs/py36/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/1p/xb7bs_j111x1pxh7km__3dx80000gp/T/pip-install-0j2takk9/sasl/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/1p/xb7bs_j111x1pxh7km__3dx80000gp/T/pip-record-1mce8tj1/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/sasl
copying sasl/init.py -> build/lib.macosx-10.7-x86_64-3.6/sasl
running egg_info
writing sasl.egg-info/PKG-INFO
writing dependency_links to sasl.egg-info/dependency_links.txt
writing requirements to sasl.egg-info/requires.txt
writing top-level names to sasl.egg-info/top_level.txt
reading manifest file 'sasl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sasl.egg-info/SOURCES.txt'
copying sasl/saslwrapper.cpp -> build/lib.macosx-10.7-x86_64-3.6/sasl
copying sasl/saslwrapper.h -> build/lib.macosx-10.7-x86_64-3.6/sasl
copying sasl/saslwrapper.pyx -> build/lib.macosx-10.7-x86_64-3.6/sasl
running build_ext
building 'sasl.saslwrapper' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/sasl
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/envs/py36/include -arch x86_64 -I/anaconda3/envs/py36/include -arch x86_64 -Isasl -I/anaconda3/envs/py36/include/python3.6m -c sasl/saslwrapper.cpp -o build/temp.macosx-10.7-x86_64-3.6/sasl/saslwrapper.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
sasl/saslwrapper.cpp:249:10: fatal error: 'string' file not found
#include
^~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/anaconda3/envs/py36/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/1p/xb7bs_j111x1pxh7km__3dx80000gp/T/pip-install-0j2takk9/sasl/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/1p/xb7bs_j111x1pxh7km__3dx80000gp/T/pip-record-1mce8tj1/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/1p/xb7bs_j111x1pxh7km__3dx80000gp/T/pip-install-0j2takk9/sasl/

@ShiqinHuo
Copy link

did u solve it?

@ShiqinHuo
Copy link

Try conda install

@sarahdavis23
Copy link
Author

conda install doesn't work either.
It's actually a problem with python-sasl. It needs to use a newer version of the C compiler. @rboyatt has made a fix for that which means I can install this package but I still couldn't get thrift_sasl to work, at which point I gave up.

@rboyatt
Copy link

rboyatt commented Jan 14, 2019

The problem seems to be in python-sasl. On recent versions of OS X you need to ensure libc++ is being used as the C++ library by specifying it with extra_compile_args. This allows python-sasl to compile and resolves the problem being described above.

Here's a fork of python-sasl with the necessary changes - https://github.com/rboyatt/python-sasl/tree/stdlib-osx

@ikingye
Copy link

ikingye commented Jan 24, 2019

MacOS:

brew install gcc@4.9
env CC=/usr/local/bin/gcc-4.9 pip install thrift_sasl==0.2.1

@JoshRosen
Copy link

I found a simple workaround: modify the build to target OS X 10.9, which has the side effect of ensuring that libc++ is used: cloudera/python-sasl#13. I originally tried using @rboyatt's suggestion of passing the -stdlib=libc++ extra compiler flag, but that still failed for me with the same error.

@zscore
Copy link

zscore commented Apr 15, 2019

For anybody who wants to use @JoshRosen's fix, you can install it via pip with the following command:
pip install git+https://github.com/JoshRosen/python-sasl.git@fix-build-with-newer-xcode

@claudiokc
Copy link

@azhar22k
Copy link

azhar22k commented Sep 5, 2019

This worked for me

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

@nmorenol
Copy link

Try conda install

It work for me. Thanks.

@dknupp dknupp closed this as completed Mar 4, 2020
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

10 participants