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

Installation Fails on Mac OS X 10.11 Beta 6 and GM #2350

Closed
ColtonProvias opened this Issue Sep 17, 2015 · 20 comments

Comments

Projects
None yet
@ColtonProvias

ColtonProvias commented Sep 17, 2015

Python Version: 3.5.0
OS Version: Mac OS X 10.11 Beta 6 and GM tested.

Running setup.py install for cryptography
    Complete output from command /Users/coltonprovias/Development/MyNewLeaf/bin/python3.5 -c "import setuptools, tokenize;__file__='/private/var/folders/zl/0vgdj8l96ss0_w20j9k0t7bm0000gn/T/pip-build-b7m8lm64/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/zl/0vgdj8l96ss0_w20j9k0t7bm0000gn/T/pip-he90mckx-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/coltonprovias/Development/MyNewLeaf/bin/../include/site/python3.5/cryptography:
    running install
    running build
    running build_py
    running egg_info
    writing entry points to src/cryptography.egg-info/entry_points.txt
    writing top-level names to src/cryptography.egg-info/top_level.txt
    writing dependency_links to src/cryptography.egg-info/dependency_links.txt
    writing src/cryptography.egg-info/PKG-INFO
    writing requirements to src/cryptography.egg-info/requires.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*' found under directory 'vectors'
    writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
    running build_ext
    generating cffi module 'build/temp.macosx-10.11-x86_64-3.5/_commoncrypto.c'
    already up-to-date
    generating cffi module 'build/temp.macosx-10.11-x86_64-3.5/_padding.c'
    already up-to-date
    generating cffi module 'build/temp.macosx-10.11-x86_64-3.5/_constant_time.c'
    already up-to-date
    generating cffi module 'build/temp.macosx-10.11-x86_64-3.5/_openssl.c'
    already up-to-date
    building '_openssl' extension
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c build/temp.macosx-10.11-x86_64-3.5/_openssl.c -o build/temp.macosx-10.11-x86_64-3.5/build/temp.macosx-10.11-x86_64-3.5/_openssl.o
    build/temp.macosx-10.11-x86_64-3.5/_openssl.c:400:10: fatal error: 'openssl/aes.h' file not found
    #include <openssl/aes.h>
             ^
    1 error generated.
    error: command 'clang' failed with exit status 1

This is due to Apple dropping support for OpenSSL and moving to their own library.

Workaround for those encountering issue:

Install OpenSSL via Homebrew and then run the following command:

env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography

No other issues encountered yet.

@reaperhulk

This comment has been minimized.

Show comment
Hide comment
@reaperhulk

reaperhulk Sep 17, 2015

Member

Yeah, we're aware of the change. Apple's removal of the El Capitan OpenSSL headers is (part of) why we chose to start shipping binary wheels for 10.10+. Our wheels are relatively conservative at the moment though so system Python (as well as Python 3.5) does not receive the wheels. We've documented the required dependencies (OpenSSL from homebrew or macports) here, although it lacks the nuance described above.

We'll be shipping universal (32-bit/64-bit) wheels in the next release along with Python 3.5 wheels to simplify this.

Thanks for the report!

Member

reaperhulk commented Sep 17, 2015

Yeah, we're aware of the change. Apple's removal of the El Capitan OpenSSL headers is (part of) why we chose to start shipping binary wheels for 10.10+. Our wheels are relatively conservative at the moment though so system Python (as well as Python 3.5) does not receive the wheels. We've documented the required dependencies (OpenSSL from homebrew or macports) here, although it lacks the nuance described above.

We'll be shipping universal (32-bit/64-bit) wheels in the next release along with Python 3.5 wheels to simplify this.

Thanks for the report!

@reaperhulk reaperhulk closed this Sep 17, 2015

@adamtheturtle

This comment has been minimized.

Show comment
Hide comment
@adamtheturtle

adamtheturtle Oct 1, 2015

For anyone viewing this because installing a package which installs cryptography with Homebrew fails, you can add the following to your recipe:

depends_on "openssl" and

ENV["LDFLAGS"] = "-L#{opt_prefix}/openssl/lib"
ENV["CFLAGS"] = "-I#{opt_prefix}/openssl/include"

adamtheturtle commented Oct 1, 2015

For anyone viewing this because installing a package which installs cryptography with Homebrew fails, you can add the following to your recipe:

depends_on "openssl" and

ENV["LDFLAGS"] = "-L#{opt_prefix}/openssl/lib"
ENV["CFLAGS"] = "-I#{opt_prefix}/openssl/include"
@gam-phon

This comment has been minimized.

Show comment
Hide comment
@gam-phon

gam-phon Oct 4, 2015

I have encountered this and the command provided in the first comment solve the issue. Running on python 2.7

gam-phon commented Oct 4, 2015

I have encountered this and the command provided in the first comment solve the issue. Running on python 2.7

@nelsonvarela

This comment has been minimized.

Show comment
Hide comment
@nelsonvarela

nelsonvarela Nov 30, 2015

I had the same problem and resolved it by upgrading globally installed virtualenv, setuptools and pip

nelsonvarela commented Nov 30, 2015

I had the same problem and resolved it by upgrading globally installed virtualenv, setuptools and pip

@busla

This comment has been minimized.

Show comment
Hide comment
@busla

busla Jan 7, 2016

the OP solution worked for me, thanks!
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography

busla commented Jan 7, 2016

the OP solution worked for me, thanks!
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography

@reaperhulk

This comment has been minimized.

Show comment
Hide comment
@reaperhulk

reaperhulk Feb 3, 2016

Member

Anyone still experiencing this issue should upgrade their pip, as it's highly likely that their installation is out of date. An up to date pip will download a binary wheel of cffi and cryptography and will not require any compilation :)

Member

reaperhulk commented Feb 3, 2016

Anyone still experiencing this issue should upgrade their pip, as it's highly likely that their installation is out of date. An up to date pip will download a binary wheel of cffi and cryptography and will not require any compilation :)

@JoaquinKeller

This comment has been minimized.

Show comment
Hide comment
@JoaquinKeller

JoaquinKeller Feb 23, 2016

the issue remains with pypy, this solution (proposed above) worked well for me:
sudo -H env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pypy -m pip install -U cryptography

JoaquinKeller commented Feb 23, 2016

the issue remains with pypy, this solution (proposed above) worked well for me:
sudo -H env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pypy -m pip install -U cryptography

@jamesone

This comment has been minimized.

Show comment
Hide comment
@jamesone

jamesone Feb 29, 2016

env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography - After an hour trying different solutions this was the one that fixed it for me.

jamesone commented Feb 29, 2016

env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography - After an hour trying different solutions this was the one that fixed it for me.

@idkjs

This comment has been minimized.

Show comment
Hide comment
@idkjs

idkjs Mar 6, 2016

Above solution does not work for me.
build/temp.macosx-10.11-x86_64-2.7/_openssl.c:431:10: fatal error:
'openssl/aes.h' file not found
#include <openssl/aes.h>
I tried running env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography in my user root and also inside my virtualenv environement, the running ./env/bin/python setup.py install inside my env folder. Still doesnt work. Perhaps the solution is no longer viable on 10.11? Any ideas? Thank you.

idkjs commented Mar 6, 2016

Above solution does not work for me.
build/temp.macosx-10.11-x86_64-2.7/_openssl.c:431:10: fatal error:
'openssl/aes.h' file not found
#include <openssl/aes.h>
I tried running env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography in my user root and also inside my virtualenv environement, the running ./env/bin/python setup.py install inside my env folder. Still doesnt work. Perhaps the solution is no longer viable on 10.11? Any ideas? Thank you.

@alex

This comment has been minimized.

Show comment
Hide comment
@alex

alex Mar 6, 2016

Member

Your best bet is to upgrade to the latest version of pip; then you'll get cryptography distributed as a wheel.

Member

alex commented Mar 6, 2016

Your best bet is to upgrade to the latest version of pip; then you'll get cryptography distributed as a wheel.

@idkjs

This comment has been minimized.

Show comment
Hide comment
@idkjs

idkjs Mar 6, 2016

I upgraded previously to pip -V
pip 8.1.0 from /usr/local/lib/python2.7/site-packages (python 2.7)

Should i go back to 8.03?

idkjs commented Mar 6, 2016

I upgraded previously to pip -V
pip 8.1.0 from /usr/local/lib/python2.7/site-packages (python 2.7)

Should i go back to 8.03?

@alex

This comment has been minimized.

Show comment
Hide comment
@alex

alex Mar 6, 2016

Member

pip 8.1.0 is fine

On Sun, Mar 6, 2016 at 9:29 AM, Alain Armand notifications@github.com
wrote:

I upgraded previously to pip -V
pip 8.1.0 from /usr/local/lib/python2.7/site-packages (python 2.7)

Should i go back to 8.03?


Reply to this email directly or view it on GitHub
#2350 (comment).

"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084

Member

alex commented Mar 6, 2016

pip 8.1.0 is fine

On Sun, Mar 6, 2016 at 9:29 AM, Alain Armand notifications@github.com
wrote:

I upgraded previously to pip -V
pip 8.1.0 from /usr/local/lib/python2.7/site-packages (python 2.7)

Should i go back to 8.03?


Reply to this email directly or view it on GitHub
#2350 (comment).

"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084

@idkjs

This comment has been minimized.

Show comment
Hide comment
@idkjs

idkjs Mar 6, 2016

Any other ideas?

idkjs commented Mar 6, 2016

Any other ideas?

@GregIngelmo

This comment has been minimized.

Show comment
Hide comment
@GregIngelmo

GregIngelmo Mar 21, 2016

OP solution worked for me...

GregIngelmo commented Mar 21, 2016

OP solution worked for me...

@fluency0105

This comment has been minimized.

Show comment
Hide comment
@fluency0105

fluency0105 Apr 26, 2016

it works ! On python 2.7,el captain 10.11.2.

fluency0105 commented Apr 26, 2016

it works ! On python 2.7,el captain 10.11.2.

tomck added a commit to tomck/core that referenced this issue Jun 22, 2016

Have pip update itself in virtualenv first
On macOS El Capitan, the virtualenv created uses an older version of pip which must compile the cryptography wheel. This fails per pyca/cryptography#2350. Having the virtualenv pip update itself before running resolves this issue which prevents ./bin/run.sh from completing "Installing Python requirements" on macOS 10.11.
@deyvsh

This comment has been minimized.

Show comment
Hide comment
@deyvsh

deyvsh Sep 5, 2016

For posterity, I had to use virtualenv-burrito upgrade to upgrade pip because (you guessed it) I'm using the excellent virtualenv-burrito.
Without doing this I got the following error:

Not uninstalling pip at /Users/dave/.venvburrito/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg, outside environment /Users/dave/.virtualenvs/ansible2++/bin/..

deyvsh commented Sep 5, 2016

For posterity, I had to use virtualenv-burrito upgrade to upgrade pip because (you guessed it) I'm using the excellent virtualenv-burrito.
Without doing this I got the following error:

Not uninstalling pip at /Users/dave/.venvburrito/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg, outside environment /Users/dave/.virtualenvs/ansible2++/bin/..

@CJeffrey

This comment has been minimized.

Show comment
Hide comment
@CJeffrey

CJeffrey Sep 28, 2016

WOW! Many thanks! This just fixed my problem!

CJeffrey commented Sep 28, 2016

WOW! Many thanks! This just fixed my problem!

pcraig3 added a commit to alphagov/digitalmarketplace-supplier-frontend that referenced this issue Dec 14, 2016

pcraig3 added a commit to alphagov/digitalmarketplace-supplier-frontend that referenced this issue Dec 14, 2016

Kill the cryptography bug
We've had a problem installing cryptography on local machines,
one solution to which is to make sure your is updated.

This pull request would add a step to the Makefile to always
upgrade pip before installing the rest of the requirements.

If we want to do this, I can port it to the other apps.

[Issue on github](pyca/cryptography#2350 (comment))

pcraig3 added a commit to alphagov/digitalmarketplace-supplier-frontend that referenced this issue Dec 15, 2016

Kill the cryptography bug
We've had a problem installing cryptography on local machines,
one solution to which is to make sure your is updated.

This pull request would add a step to the Makefile to always
upgrade pip before installing the rest of the requirements.

If we want to do this, I can port it to the other apps.

[Issue on github](pyca/cryptography#2350 (comment))

pcraig3 added a commit to alphagov/digitalmarketplace-supplier-frontend that referenced this issue Dec 16, 2016

Kill the cryptography bug
We've had a problem installing cryptography on local machines,
one solution to which is to make sure your is updated.

This pull request would add a step to the Makefile to always
upgrade pip before installing the rest of the requirements.

If we want to do this, I can port it to the other apps.

[Issue on github](pyca/cryptography#2350 (comment))

pcraig3 added a commit to alphagov/digitalmarketplace-buyer-frontend that referenced this issue Dec 16, 2016

Kill the cryptography bug
We've had a problem installing cryptography on local machines,
one solution to which is to make sure your 'pip' is updated.

This pull request would add a step to the Makefile to always
upgrade pip before installing the rest of the requirements.

Same as was in the supplier app.

[Issue on github](pyca/cryptography#2350 (comment))

pcraig3 added a commit to alphagov/digitalmarketplace-admin-frontend that referenced this issue Dec 16, 2016

Kill the cryptography bug
We've had a problem installing cryptography on local machines,
one solution to which is to make sure your 'pip' is updated.

This pull request would add a step to the Makefile to always
upgrade pip before installing the rest of the requirements.

Same as was in the supplier app.

[Issue on github](pyca/cryptography#2350)
@llazzaro

This comment has been minimized.

Show comment
Hide comment
@llazzaro

llazzaro commented Mar 18, 2017

I manage to solve it following this instructions

@hidehiro98

This comment has been minimized.

Show comment
Hide comment
@hidehiro98

hidehiro98 Oct 24, 2017

env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography does not work for me.

But this works for me.

My PC is macOS High Sierra.

hidehiro98 commented Oct 24, 2017

env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography does not work for me.

But this works for me.

My PC is macOS High Sierra.

@mhchia

This comment has been minimized.

Show comment
Hide comment
@mhchia

mhchia Dec 18, 2017

@hidehiro98 your solution also works for me. Thanks!
Mine is macOS High Sierra as well.

mhchia commented Dec 18, 2017

@hidehiro98 your solution also works for me. Thanks!
Mine is macOS High Sierra as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment