aztk
aztk copied to clipboard
Can't install on WSL because of cryptography dependency
trafficstars
Attempting to install 0.7.0 on Windows Subsystem for Linux fails on the cryptography dependency, which some Googling suggests isn't supported yet on WSL.
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c build/temp.linux-x86_64-3.5/_openssl.c -o build/temp.linux-x86_64-3.5/build/temp.linux-x86_64-3.5/_openssl.o -Wconversion -Wno-error=sign-conversion
build/temp.linux-x86_64-3.5/_openssl.c:493:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for cryptography
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1nbcggmr/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5axdk30v-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-1nbcggmr/cryptography/
I was able to reproduce and confirm this issue. I am assuming you are using the Ubuntu distro for WSL. I was also able to resolve it by running the following
# create virtual env
python3 -m venv .venv
source .venv/bin/activate
# install some libraries to build cryptography from source
sudo apt-get install build-essential libssl-dev libffi-dev python3-dev
pip install cryptography --no-cache --no-binary cryptography
Building from source seems to resolve the issue. Let me know if this works for you as well.
This is an unfortunate workaround, though. I'd recommend that Windows users use a different shell if possible.
That resolved the immediate issue on Ubuntu WSL (after installing python3-venv). Thank you.