Posted at

Failed building wheel for cryptographyが出てきた時

More than 3 years have passed since last update.

Ansible実行時に以下のエラーが出力された際の対応

root@vagrant-ubuntu-trusty-64:/vagrant# ansible-p

ansible-playbook ansible-pull
root@vagrant-ubuntu-trusty-64:/vagrant# ansible-playbook -i hosts web-notls.yml
Traceback (most recent call last):
File "/usr/local/bin/ansible-playbook", line 4, in <module>
import pkg_resources
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 444, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 725, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: cryptography>=1.1

1.1以上のcryptographyというパッケージが無いとのこと

cryptographyをインストールしようとしたが、今度は

Failed building wheel for cryptography

というエラーが出力

root@vagrant-ubuntu-trusty-64:~# pip install cryptography

Collecting cryptography
Using cached cryptography-1.4.tar.gz
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Failed building wheel for cryptography

以下URLで同じように困ってる人がいた

http://stackoverflow.com/questions/22073516/failed-to-install-python-cryptography-package-with-pip-and-setup-py

以下のをインストールすることにより依存関係を解消できるとのこと

root@vagrant-ubuntu-trusty-64:~# apt-get install build-essential libssl-dev libffi-dev python-dev

もう一度cryptographyをインストール



root@vagrant-ubuntu-trusty-64:~# pip install cryptography