1 系统环境:CentOS 5.8 x64
2 默认情况下:Python 版本为:
3 [root@web2 ~]# python -V
4 Python 2.4.3
5
6 由于安装paramiko 需要Python 2.5+ 所以此时需要对Python 进行升级
7 安装Python
8
9 删除旧版本的gmp
10 [root@web1 py]# rpm -e gmp-4.1.4-10.el5 --nodeps
11 error: "gmp-4.1.4-10.el5" specifies multiple packages
12 [root@web1 py]# rpm -e gmp-4.1.4-10.el5 --nodeps --allmatches
13
14 wget http://www.python.org/ftp/python/2.6.8/Python-2.6.8.tar.bz2
15 wget https://pypi.python.org/packages/source/p/paramiko/paramiko-1.7.6.zip --no-check-certificate
16 wget https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.tar.gz --no-check-certificate
17 wget http://ftp.gnu.org/gnu/gmp/gmp-5.0.5.tar.bz2
18
19
20 tar jvfx gmp-5.0.5.tar.bz2
21 cd gmp-5.0.5
22 ls
23 ./configure
24 make
25 make install
26 make check
27 cd ..
28
29 yum install gcc* autoconf automake -y
30 tar jvfx Python-2.6.8.tar.bz2
31 cd Python-2.6.8
32 ./configure
33 make && make install
34 cd ..
35
36 #重启服务器 使安装生效
37 tar zvfx pycrypto-2.6.tar.gz
38 cd pycrypto-2.6
39 python setup.py build
40 python setup.py install
41 cd ..
42
43 unzip paramiko-1.7.6.zip
44 cd paramiko-1.7.6
45 python setup.py install
46 cd ..
47
48 >>> import paramiko
49 /usr/local/lib/python2.6/site-packages/Crypto/Util/randpool.py:40: RandomPool_DeprecationWarning: \
50 This application uses RandomPool, which is BROKEN in older releases. See http://www.pycrypto.org/randpool-broken
51 RandomPool_DeprecationWarning)
52
53 vi /usr/local/lib/python2.6/site-packages/Crypto/Util/randpool.py
54 去掉39 40行 测试ok
yum 方式安装
yum install python-crypto python-paramiko -y