This article introduces the installation process of Linux host Python Paramiko in the intranet environment.
If the host can access the Internet, a command will be able to all the program dependencies are installed, but the actual production environment of the server is not on the outside network, the program depends on the package can only be installed by the administrator one to install, during the encounter a variety of problems, lack of packages, version incompatibility is often the case. I myself in the installation of Paramiko process, encountered problems online query, found that the information on the Internet is mostly installed in the network or Windows environment, and does not apply to the Linux off-grid situation.
For posterity to guide, also for oneself later install again may use, special will install the process record down, contribute oneself of a meager power.
Basic Environment: centos6.5,python3.6
Python Package installation command: Python3 setup.py install
Note: After installing Linux under python3.6, use the 3.6 command for Python3 and run Python directly as the original Python2 version. You can change the python command soft link to point to Python3, which is not described here.
1. Installing the GCC Environment
Yum-y Install gcc*
The local Yum source download installs the following files:
Downloading Packages:
(1/17): ecj-3.4.2-6.el6.x86_64.rpm
(2/17): gcc-c++-4.4.7-16.el6.x86_64.rpm
(3/17): gcc-gfortran-4.4.7-16.el6.x86_64.rpm
(4/17): gcc-gnat-4.4.7-16.el6.x86_64.rpm
(5/17): gcc-java-4.4.7-16.el6.x86_64.rpm
(6/17): gcc-objc-4.4.7-16.el6.x86_64.rpm
(7/17): gcc-objc++-4.4.7-16.el6.x86_64.rpm
(8/17): java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64.rpm
(9/17): java_cup-0.10k-5.el6.x86_64.rpm
(10/17): libgcj-4.4.7-16.el6.x86_64.rpm
(11/17): libgcj-devel-4.4.7-16.el6.x86_64.rpm
(12/17): libgfortran-4.4.7-16.el6.x86_64.rpm
(13/17): libgnat-4.4.7-16.el6.x86_64.rpm
(14/17): libgnat-devel-4.4.7-16.el6.x86_64.rpm
(15/17): libobjc-4.4.7-16.el6.x86_64.rpm
(16/17): libstdc++-devel-4.4.7-16.el6.x86_64.rpm
(17/17): sinjdoc-0.5-9.1.el6.x86_64.rpm
2. Then install Paramiko-dependent Python packages, in the following order
Pycparser-2.18.tar.gz
Pyasn1-0.3.7.tar.gz
Cffi-1.11.2.tar.gz
Six-1.11.0.tar.gz
Pynacl-1.1.2.tar.gz
Asn1crypto-0.23.0.tar.gz
Idna-2.6.tar.gz
Cryptography-2.1.1.tar.gz
Bcrypt-3.1.4.tar.gz
3. Final installation of paramiko-2.3.1.tar.gz
--------------------------------------------------------------
The errors encountered during the installation process are logged as follows:
First, installation cffi-1.11.2 error is as follows
1.
Package Libffi is 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
Baidu query is because find libffi.pc, use the Find/-name libffi.pc command Lookup, and then copy libffi.pc files to/usr/lib64/pkgconfig (32-bit Linux is/usr/lib/ Pkgconfig), Problem solving
2.
C/_cffi_backend.c:15:17:error:ffi.h:no such file or directory
In file included from c/_cffi_backend.c:92:
By installing libffi-3.0.9-1.3.x86_64.rpm and libffi-devel-3.0.9-1.3.x86_64.rpm, the first problem should also be resolved in this way, but the first problem is solved when you encounter the 2nd issue
Second, installation cryptography-2.1.1 error
Build/temp.linux-x86_64-3.6/_openssl.c:483:30:error:openssl/opensslv.h:no such file or directory
Missing files, installing Openssl-devel resolution
Yum Install openssl-devel*
Downloading Packages:
(1/7): keyutils-libs-devel-1.4-5.el6.x86_64.rpm
(2/7): krb5-devel-1.10.3-42.el6.x86_64.rpm
(3/7): libcom_err-devel-1.41.12-22.el6.x86_64.rpm
(4/7): libselinux-devel-2.0.94-5.8.el6.x86_64.rpm
(5/7): libsepol-devel-2.0.41-4.el6.x86_64.rpm
(6/7): openssl-1.0.1e-48.el6_8.1.x86_64.rpm
(7/7): openssl-devel-1.0.1e-48.el6_8.1.x86_64.rpm
-----------------------------------------------------------
[Python] Install Paramiko module record under Linux