繁体   English   中英

Ansible 2.x安装由于paramiko 2.0依赖关系更改而失败

[英]Ansible 2.x install fails due to paramiko 2.0 dependency changes

由于paramiko 2.0将其依赖性从pycrypto更改为加密,因此无法通过pip安装最新的Ansible。 密码学依赖于cffi,这需要libffi-dev。 有谁知道如何解决这一问题? (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: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For 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: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For 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 for collected packages: ansible, PyYAML, pycrypto, cryptography, MarkupSafe, cffi, pycparser
  Running setup.py bdist_wheel for ansible: started
  Running setup.py bdist_wheel for ansible: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/7a/56/e4/5dbcf0564a8cad5175b8c85bb123fdc81ad48bd31d27ac6011
  Running setup.py bdist_wheel for PyYAML: started
  Running setup.py bdist_wheel for PyYAML: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/4a/bf/14/d79994d19a59d4f73efdafb8682961f582d45ed6b459420346
  Running setup.py bdist_wheel for pycrypto: started
  Running setup.py bdist_wheel for pycrypto: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/80/1f/94/f76e9746864f198eb0e304aeec319159fa41b082f61281ffce
  Running setup.py bdist_wheel for cryptography: started
  Running setup.py bdist_wheel for cryptography: finished with status 'error'
  Complete output from 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 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the 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 and 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 with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cryptography
  Running setup.py clean for cryptography
  Complete output from 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 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the 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 and 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 with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

要从pip安装libffi cryptography >= 1.1 ,您需要安装libffi的开发人员软件包,因为它将包含缺少的头文件。 自从您标记了Ubuntu以来,我假设您正在使用apt软件包管理器。

apt-get install libffi-dev

您还需要发行版等效于ssl的开发包和gcc用于cryptography >= 1.1等于cryptography >= 1.1 如果您在系统环境中运行此程序,那么几乎可以肯定已经安装了gcc ,但是如果缺少,则可能还需要apt-get install libssl-dev

Fedora / RHEL的等效项是libffi-developenssl-devel ,并且可以与dnfyum一起安装,具体取决于您的操作系统和版本。

发现一种解决方案是安装每种的特定版本:

pip install paramiko==1.17.0 ansible==2.0.0.2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM