2016-06-06 9 views
1

Недавно я пытаюсь изучить python и написать некоторые скрипты во время работы. Однако я обнаружил, что мой python не обновляется до настоящего времени. Поэтому я обновляюсь с 2.6 до 2.7.6 после некоторого руководства от сети. После этого python, pip и easy_install кажутся все в порядке. Затем я попытался установить Paramiko, используя pip. Ошибка показывает, что libffi не найден ниже. Однако, когда я пытался установить libffi, он показывает уже там. Я попытался найти там какие-либо другие пакеты, но их нет.Не удается установить Paramiko в Cent OS

Проблема в том, что pip пытался найти libffi.pc, но он не находится ни в одном пакете.

Может ли кто-нибудь дать мне руку?

Спасибо!


[[email protected] ~]# pip install paramiko 
Requirement already satisfied (use --upgrade to upgrade): paramiko in /usr/local/lib/python2.7/site-packages/paramiko-2.0.0-py2.7.egg 
Collecting cryptography>=1.1 (from paramiko) 
/usr/local/lib/python2.7/site-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/site-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 
    Using cached cryptography-1.4.tar.gz 
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.7 in /usr/local/lib/python2.7/site-packages (from paramiko) 
Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko) 
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.1 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko) 
Requirement already satisfied (use --upgrade to upgrade): setuptools>=11.3 in /usr/local/lib/python2.7/site-packages/setuptools-22.0.5-py2.7.egg (from cryptography>=1.1->paramiko) 
Requirement already satisfied (use --upgrade to upgrade): enum34 in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko) 
Requirement already satisfied (use --upgrade to upgrade): ipaddress in /usr/local/lib/python2.7/site-packages (from cryptography>=1.1->paramiko) 
Collecting cffi>=1.4.1 (from cryptography>=1.1->paramiko) 
    Using cached cffi-1.6.0.tar.gz 
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/local/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography>=1.1->paramiko) 
Building wheels for collected packages: cryptography, cffi 
    Running setup.py bdist_wheel for cryptography ... error 
    Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-TN9_mw/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpQ9VyZFpip-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: error: ffi.h: No such file or directory 
    In file included from c/_cffi_backend.c:63: 

[[email protected] ~]# yum install libffi 
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager 
Setting up Install Process 
Package libffi-3.0.5-3.2.el6.x86_64 already installed and latest version 
Nothing to do 

[[email protected] ~]# yum search libffi 
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager 
====================================================================================== N/S Matched: libffi ====================================================================================== 
libffi.i686 : A portable foreign function interface library 
libffi.x86_64 : A portable foreign function interface library 

    Name and summary matches only, use "search all" for everything. 

[[email protected] ~]# rpm -ql libffi.x86_64 
/usr/lib64/libffi.so.5 
/usr/lib64/libffi.so.5.0.6 
/usr/share/doc/libffi-3.0.5 
/usr/share/doc/libffi-3.0.5/LICENSE 
/usr/share/doc/libffi-3.0.5/README 


[[email protected] ~]# yum install libffi-devel 
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager 
Setting up Install Process 
No package libffi-devel available. 
Error: Nothing to do 

[[email protected] ~]# yum upgrade libffi-devel 
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager 
Setting up Upgrade Process 
No Match for argument: libffi-devel 
No package libffi-devel available. 
No Packages marked for Update 
[[email protected] ~]# yum upgrade libffi 
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager 
Setting up Upgrade Process 
No Packages marked for Update 

[[email protected] ~]# locate libffi 
/opt/Python-2.7.6/Modules/_ctypes/libffi 
/opt/Python-2.7.6/Modules/_ctypes/libffi.diff 
/opt/Python-2.7.6/Modules/_ctypes/libffi_arm_wince 
/opt/Python-2.7.6/Modules/_ctypes/libffi_msvc 
...... 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/libffi/src/xtensa/.deps/sysv.Plo 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/libffi/testsuite/Makefile 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi/src 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi/src/closures.o 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi/src/prep_cif.o 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi/src/x86 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi/src/x86/ffi.o 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi/src/x86/ffi64.o 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi/src/x86/sysv.o 
/opt/Python-2.7.6/build/temp.linux-x86_64-2.7/opt/Python-2.7.6/Modules/_ctypes/libffi/src/x86/unix64.o 
/usr/lib64/libffi.so.5 
/usr/lib64/libffi.so.5.0.6 
/usr/share/doc/libffi-3.0.5 
/usr/share/doc/libffi-3.0.5/LICENSE 
/usr/share/doc/libffi-3.0.5/README 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64/checksum_data 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64/checksum_type 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64/from_repo 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64/from_repo_revision 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64/from_repo_timestamp 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64/installed_by 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64/reason 
/var/lib/yum/yumdb/l/66af3a78b71c9ab35c98a0a9bcd1cb15d195d206-libffi-3.0.5-3.2.el6-x86_64/releasever 
+0

Попробуйте удалить его и снова установить. – NepCoder

+0

Спасибо NepCoder! Похоже, я не могу легко удалить этот пакет, поскольку он используется Python и другими вещами. [root @ vmx-dsm-038 ~] # rpm -e libffi.x86_64 error: Failed dependencies: libffi.so.5() (64 бит) необходим (установлен) jna-3.2.4-2.el6. x86_64 libffi.so.5() (64 бит) необходим (установлен) python-libs-2.6.6-64.el6.x86_64 libffi необходим (установлен) jna-3.2.4-2.el6.x86_64 –

+0

Можете ли вы проверить, что libffi - это последняя версия? Я бы посмотрел на обновление, если доступно новое обновление. Эта страница может быть полезна: http://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip – NepCoder

ответ

0

Я наконец-то нашел решение для этого. Благодаря NepCoder! Я вручную скачаю libffi-devel со страницы https://pkgs.org/centos-6/centos-x86_64/libffi-devel-3.0.5-3.2.el6.x86_64.rpm.html. Затем используйте «rpm -ivh libffi-devel-3.0.5-3.2.el6.x86_64.rpm», чтобы установить его на мою виртуальную машину.

Все работает отлично после этого. Я предполагаю, что у моего репозитория yum что-то не так.

+0

это здорово. – NepCoder

 Смежные вопросы

  • Нет связанных вопросов^_^