python - Ansible 2.x install fails due to paramiko 2.0 dependency changes -


installing latest ansible via pip fails due paramiko 2.0 changing dependency pycrypto cryptography. cryptography has dependency on cffi, requires libffi-dev. know how fix this? (ubuntu trusty 14.04)

run pip install --upgrade ansible  ---> running in 8ef89649c480 collecting ansible /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: snimissingwarning: https request has been made, sni (subject name indication) extension tls not available on platform. may cause server present incorrect tls certificate, can cause validation failures. can upgrade newer version of python solve this. more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.   snimissingwarning /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. can upgrade newer version of python solve this. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.   insecureplatformwarning   downloading ansible-2.0.2.0.tar.gz (1.5mb) collecting paramiko (from ansible)   downloading paramiko-2.0.0-py2.py3-none-any.whl (170kb) collecting jinja2 (from ansible)   downloading jinja2-2.8-py2.py3-none-any.whl (263kb) collecting pyyaml (from ansible)   downloading pyyaml-3.11.zip (371kb) collecting setuptools (from ansible)   downloading setuptools-21.2.1-py2.py3-none-any.whl (509kb) collecting pycrypto>=2.6 (from ansible)   downloading pycrypto-2.6.1.tar.gz (446kb) collecting cryptography>=1.1 (from paramiko->ansible)   downloading cryptography-1.3.2.tar.gz (383kb) collecting pyasn1>=0.1.7 (from paramiko->ansible)   downloading pyasn1-0.1.9-py2.py3-none-any.whl collecting markupsafe (from jinja2->ansible)   downloading markupsafe-0.23.tar.gz collecting idna>=2.0 (from cryptography>=1.1->paramiko->ansible)   downloading idna-2.1-py2.py3-none-any.whl (54kb) collecting six>=1.4.1 (from cryptography>=1.1->paramiko->ansible)   downloading six-1.10.0-py2.py3-none-any.whl collecting enum34 (from cryptography>=1.1->paramiko->ansible)   downloading enum34-1.1.6-py2-none-any.whl collecting ipaddress (from cryptography>=1.1->paramiko->ansible)   downloading ipaddress-1.0.16-py27-none-any.whl collecting cffi>=1.4.1 (from cryptography>=1.1->paramiko->ansible)   downloading cffi-1.6.0.tar.gz (397kb) collecting pycparser (from cffi>=1.4.1->cryptography>=1.1->paramiko->ansible)   downloading pycparser-2.14.tar.gz (223kb) building wheels collected packages: ansible, pyyaml, pycrypto, cryptography, markupsafe, cffi, pycparser   running setup.py bdist_wheel ansible: started   running setup.py bdist_wheel ansible: finished status 'done'   stored in directory: /root/.cache/pip/wheels/7a/56/e4/5dbcf0564a8cad5175b8c85bb123fdc81ad48bd31d27ac6011   running setup.py bdist_wheel pyyaml: started   running setup.py bdist_wheel pyyaml: finished status 'done'   stored in directory: /root/.cache/pip/wheels/4a/bf/14/d79994d19a59d4f73efdafb8682961f582d45ed6b459420346   running setup.py bdist_wheel pycrypto: started   running setup.py bdist_wheel pycrypto: finished status 'done'   stored in directory: /root/.cache/pip/wheels/80/1f/94/f76e9746864f198eb0e304aeec319159fa41b082f61281ffce   running setup.py bdist_wheel cryptography: started   running setup.py bdist_wheel cryptography: finished status 'error'   complete output command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-u7yvav/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpqa7glcpip-wheel- --python-tag cp27:   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   c/_cffi_backend.c:15:17: fatal error: ffi.h: no such file or directory    #include <ffi.h>                    ^   compilation terminated.   traceback (most recent call last):     file "<string>", line 1, in <module>     file "/tmp/pip-build-u7yvav/cryptography/setup.py", line 335, in <module>       **keywords_with_side_effects(sys.argv)     file "/usr/lib/python2.7/distutils/core.py", line 111, in setup       _setup_distribution = dist = klass(attrs)     file "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 239, in __init__       self.fetch_build_eggs(attrs.pop('setup_requires'))     file "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 264, in fetch_build_eggs       replace_conflicting=true     file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 620, in resolve       dist = best[req.key] = env.best_match(req, ws, installer)     file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 858, in best_match       return self.obtain(req, installer) # try , download/install     file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 870, in obtain       return installer(requirement)     file "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 314, in fetch_build_egg       return cmd.easy_install(req)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 616, in easy_install       return self.install_item(spec, dist.location, tmpdir, deps)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 646, in install_item       dists = self.install_eggs(spec, download, tmpdir)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggs       return self.build_and_install(setup_script, setup_base)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_install       self.run_setup(setup_script, setup_base, args)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1028, in run_setup       raise distutilserror("setup script exited %s" % (v.args[0],))   distutils.errors.distutilserror: setup script exited error: command 'x86_64-linux-gnu-gcc' failed exit status 1    ----------------------------------------   failed building wheel cryptography   running setup.py clean cryptography   complete output command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-u7yvav/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all:   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   package libffi not found in pkg-config search path.   perhaps should add directory containing `libffi.pc'   pkg_config_path environment variable   no package 'libffi' found   c/_cffi_backend.c:15:17: fatal error: ffi.h: no such file or directory    #include <ffi.h>                    ^   compilation terminated.   traceback (most recent call last):     file "<string>", line 1, in <module>     file "/tmp/pip-build-u7yvav/cryptography/setup.py", line 335, in <module>       **keywords_with_side_effects(sys.argv)     file "/usr/lib/python2.7/distutils/core.py", line 111, in setup       _setup_distribution = dist = klass(attrs)     file "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 239, in __init__       self.fetch_build_eggs(attrs.pop('setup_requires'))     file "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 264, in fetch_build_eggs       replace_conflicting=true     file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 620, in resolve       dist = best[req.key] = env.best_match(req, ws, installer)     file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 858, in best_match       return self.obtain(req, installer) # try , download/install     file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 870, in obtain       return installer(requirement)     file "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 314, in fetch_build_egg       return cmd.easy_install(req)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 616, in easy_install       return self.install_item(spec, dist.location, tmpdir, deps)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 646, in install_item       dists = self.install_eggs(spec, download, tmpdir)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggs       return self.build_and_install(setup_script, setup_base)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_install       self.run_setup(setup_script, setup_base, args)     file "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1028, in run_setup       raise distutilserror("setup script exited %s" % (v.args[0],))   distutils.errors.distutilserror: setup script exited error: command 'x86_64-linux-gnu-gcc' failed exit status 1 

to install cryptography >= 1.1 pip, need install developer package libffi since contain missing header file. since tagged ubuntu, assuming using apt package manager.

apt-get install libffi-dev

you need distro's equivalent of ssl's development package , gcc cryptography >= 1.1. if running in system environment gcc installed, may need apt-get install libssl-dev if missing.

the fedora/rhel equivalents libffi-devel , openssl-devel, , can installed dnf or yum depending on os , version.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -