Skip to content

Install fails with cryptography 2.6 #108

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
craigcarl-oracle opened this issue Feb 27, 2019 · 12 comments
Closed

Install fails with cryptography 2.6 #108

craigcarl-oracle opened this issue Feb 27, 2019 · 12 comments

Comments

@craigcarl-oracle
Copy link

Issue:

Starting with cryptography 2.6 (released today) the SDK won't install in a Python 3.6 virtualenv. I expect it won't install anywhere but I haven't tested that. The SDK should install using the documented process, pip install oci.

NOTE: There appears to be an open ticket here -> pyca/cryptography#4789. This may get resolved upstream.

Error:

...
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.linux-x86_64-3.6/_padding.c'
creating build/temp.linux-x86_64-3.6
generating cffi module 'build/temp.linux-x86_64-3.6/_constant_time.c'
generating cffi module 'build/temp.linux-x86_64-3.6/_openssl.c'
building '_openssl' extension
creating build/temp.linux-x86_64-3.6/build
creating build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c build/temp.linux-x86_64-3.6/_openssl.c -o build/temp.linux-x86_64-3.6/build/temp.linux-x86_64-3.6/_openssl.o -Wconversion -Wno-error=sign-conversion
 error: command 'gcc' failed with exit status 1
 ----------------------------------------
 Failed building wheel for cryptography
 Running setup.py clean for cryptography
Failed to build cryptography
Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

Workaround:

Install cryptography 2.5 before installing the SDK -

pip install cryptography==2.5
pip install oci

Repo:

I'm running this in the Oracle-Linux-7.6-2019.01.17-0 image on OCI.

sudo yum install -y python36 python-pip
sudo pip install virtualenvwrapper

mkdir workdir && cd workdir
echo 'export WORKON_HOME=$HOME/.virtualenvs' >> ~/.bash_profile
echo 'export PROJECT_HOME=$HOME/Devel' >> ~/.bash_profile
echo 'source /usr/bin/virtualenvwrapper.sh' >> ~/.bash_profile
source ~/.bash_profile
mkvirtualenv workdir --python=python3.6
echo 'cd ~/workdir && workon workdir' >> ~/.bash_profile
source ~/.bash_profile
pip install oci

References:

@arthall
Copy link
Contributor

arthall commented Feb 28, 2019

Cryptography has been updated on PyPi. I don't think any one should run into this now, but I'll leave the ticket open for a couple days just in case.

@craigcarl-oracle
Copy link
Author

The upstream fix has resolved the issue. Closing.

@jvanlangen
Copy link

jvanlangen commented Sep 20, 2019

Too bad, i'm having the message Building wheel for cryptography (PEP 517) ... error constantly..
"ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly"

It's very frustrating..
~linux.noob

@dumians
Copy link

dumians commented Dec 10, 2019

i have same error
Building wheels for collected packages: cryptography
Building wheel for cryptography (PEP 517): started
Building wheel for cryptography (PEP 517): finished with status 'error'
pip3 : ERROR: Command errored out with exit status 1:
At line:1 char:1

  • pip3 install cryptography==2.5

@jodoglevy
Copy link
Contributor

Hi @jvanlangen @dumians - if you are still having this problem, can you open a new ticket for your issue? This issue is resolved already, and your issue looks different than the original issue

@GoodiesHQ
Copy link

@jodoglevy Hello! I was experiencing the same issue with a python 3.8 virtualenv. Even installing the newest version of cryptography from pypi, I was running into the PEP 517 error. After looking at the error though, it was simply because the OpenSSL include/lib path was not found by Python. To fix this, I set the following system environment variables pointing to my openssl installation path:

LIB=C:\Program Files (x86)\OpenSSL-Win32\lib;%LIB%
INCLUDE=C:\Program Files (x86)\OpenSSL-Win32\include;%INCLUDE%

After this, I was able to build cryptography (and pgpy, subsequently).

@dumians
Copy link

dumians commented Dec 22, 2019

@jvanlangen it is not solved on Python 3.8, using 3.7.5 works. Btw. pip install oci works without problems but with oci-cli not.

@bfmn2k
Copy link

bfmn2k commented Dec 23, 2019

I ran into a problem with the cryptograpy module, while installin pyAesCrypt
(Windows10 x64, Pytho3.8 x64)

build\lib.win-amd64-3.8\cryptography\hazmat\bindings\_openssl.cp38-win_amd64.pyd : fatal error LNK1120: 863 nicht aufgelöste Externe error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX86\\x64\\link.exe' failed with exit status 1120

I switched today from python x86 to x64, but copied the *lib and include from openSSL x86 to the python folder.
Could resolve this by downloading the openssl x64 (https://slproweb.com/products/Win32OpenSSL.html) and copy the *.lib from "OpenSSL-Win64\lib" to "python\libs" and the Folder openssl from "OpenSSL-Win64\include" to "python\include".

@camilocaquimbo
Copy link

I got this error trying to install Scrapy with Python 3.8.1 on Windows 10, but its solved installing the last version of pip (19.3.1 in my case) and all works using pip in this way: python -m pip install scrapy --user

@Anu2006
Copy link

Anu2006 commented Jan 4, 2020

use python -m pip install --upgrade pip then
use python -m pip install "your package"

@ixre
Copy link

ixre commented Jun 13, 2020

Hi, you should install python3-openssl first.

@Chrtol
Copy link

Chrtol commented Sep 9, 2020

The environment-variables didn't work for me, but these steps worked for me:

  1. copy the openssl folder from C:\OpenSSL-Win32\include\ to C:\Pyhton38\include\

  2. copy all libs from C:\OpenSSL-win32\lib to C:\Python38\Libs\

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