2016-05-25 2 views
2

Установка последней версии Ansible via pip завершилась неудачей из-за того, что paramiko 2.0 изменил свою зависимость от pycrypto до криптографии. Криптография имеет зависимость от cffi, для которой требуется libffi-dev. Кто-нибудь знает, как это исправить? (Ubuntu Trusty 14,04)Ошибка Ansible 2.x из-за изменений зависимостей paramiko 2.0

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 

ответ

5

Чтобы установить cryptography >= 1.1 от ПУМ, вам необходимо установить пакет разработчика для libffi, поскольку он будет содержать отсутствующий файл заголовка. Поскольку вы отметили Ubuntu, я предполагаю, что вы используете диспетчер пакетов apt.

apt-get install libffi-dev

Вам также понадобится эквивалент вашего дистрибутива пакета разработки ssl «s и gcc для cryptography >= 1.1. Если вы запускаете это в своей системной среде, то gcc почти наверняка уже установлен, но вам может понадобиться и apt-get install libssl-dev, если этого не хватает.

Fedora/RHEL эквиваленты libffi-devel и openssl-devel, и может быть установлен с dnf или yum в зависимости от операционной системы и версии.

+0

Спасибо, установка libffi-dev заставила меня идти. Ура! – Michael

+1

Обратите внимание, что для Trusty (Ubuntu 14.04) зависимость OpenSSL - это libssl-dev –

+0

@JimDennis хорошая выноска; ответ обновлен. –

0

Найдено одно решение установить конкретные версии каждого:

pip install paramiko==1.17.0 ansible==2.0.0.2 
Смежные вопросы