Kürzlich versuche ich Python zu lernen und schreiben einige Skripte während der Arbeit. Wie auch immer, ich habe festgestellt, dass mein Python nicht auf dem neuesten Stand ist. Also upgrade ich von 2.6 auf 2.7.6 und folge einem Guide aus dem Netzwerk. Danach scheinen Python, Pip und easy_install in Ordnung zu sein. Dann habe ich versucht, Paramiko mit Pip zu installieren. Der Fehler zeigt die libffi nicht gefunden wie unten. Aber als ich versucht habe, libffi zu installieren, zeigt es sich schon dort. Ich habe versucht, dort nach anderen Paketen zu suchen, aber es gibt keine.Kann Paramiko in Cent OS nicht installieren
Das Problem ist, dass Pip versucht, libffi.pc zu finden, aber es ist nicht in jedem der Paket.
Kann mir jemand helfen?
Danke!
[[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
Versuchen Sie, es zu entfernen und erneut zu installieren. – NepCoder
Danke NepCoder! Sieht so aus, als könnte ich das Paket nicht einfach entfernen, da es von Python und anderen Dingen benutzt wird. [root @ vmx-dsm-038 ~] # rpm -e libffi.x86_64 Fehler: Fehlgeschlagene Abhängigkeiten: libffi.so.5() (64bit) wird von (installiert) jna-3.2.4-2.el6 benötigt. x86_64 libffi.so.5() (64bit) wird benötigt von (installiert) python-libs-2.6.6-64.el6.x86_64 libffi wird von (installiert) jna-3.2.4-2.el6.x86_64 benötigt –
Können Sie überprüfen, ob libffi die neueste Version ist? Ich würde versuchen, es zu aktualisieren, wenn ein neues Update verfügbar ist. Diese Seite könnte hilfreich sein: http://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip – NepCoder