tox -e py27报错

ubuntu 18.04上,在一个openstack项目中执行tox -e py27

报错:

Running setup.py bdist_wheel for cryptography: started
Running setup.py bdist_wheel for cryptography: finished with status 'error'
Complete output from command /home/wanghongtao/easystack/code/easystack-code/dr-dashboard/.tox/py27/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-iX7pmh/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace(' ', ' ');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-9e1FFL --python-tag cp27:

...

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

解决方案:

1.sudo apt-get install python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev

第一步搞完,发现执行tox -e py27还是报cryptograhpy,这时候执行第二步。

2.sudo apt install libssl1.0

参考:https://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py/39457962 

每天做好自己该做的事情,你就不会感到迷茫。
原文地址:https://www.cnblogs.com/sosogengdongni/p/11249497.html