close


from:http://www.cclove.me/No_module_name_zlib_in_python2_7_3.html



CentOS5.8上的python是2.4,没有multiprocessing模块

于是加入epel源,装了源里面的最新的python,python2.6,感觉挺好的

然后某天,报错没有argparse模块

于是,源码编译python2.7,但是报错没有paramiko模块

于是下载了paramiko模块装上

再次报没有pycrypto模块

我再下载pycrypto模块装上

再import paramiko,说没有zlib模块






[root@cclove ~]# python27 Python 2.7.3 (default, Sep 30 2012,
02:06:00) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type
"help", "copyright", "credits" or "license" for more information.
>>> import paramiko
/cclove/python27/lib/python2.7/site-packages/Crypto/Util/number.py:57:
PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild
using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp
>= 5 to avoid timing attack vulnerability.",
PowmInsecureWarning) Traceback (most recent call last): File "",
line 1, in File
"/cclove/python27/lib/python2.7/site-packages/paramiko/__init__.py",
line 62, in from transport import SecurityOptions, Transport File
"/cclove/python27/lib/python2.7/site-packages/paramiko/transport.py",
line 37, in from paramiko.compress import ZlibCompressor,
ZlibDecompressor File
"/cclove/python27/lib/python2.7/site-packages/paramiko/compress.py",
line 23, in import zlib ImportError: No module named zlib
>>>





找了好久,没有python的zlib模块下载

find了一下系统的zlib,找到了python2.7.3的源码目录里面有zlib的源文件

于是再看了一下configure

于是configure的时候带上--with-zlib参数

再次编译,再次装上paramiko模块和pycrypto

这次没报少模块了

但是它报GMP太老





[root@cclove ~]# python27 Python 2.7.3 (default, Nov 24 2012,
02:51:19) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type
"help", "copyright", "credits" or "license" for more information.
>>> import paramiko
/cclove/python27/lib/python2.7/site-packages/Crypto/Util/number.py:57:
PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild
using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp
>= 5 to avoid timing attack vulnerability.",
PowmInsecureWarning) >>>


于是我用源码更新了GMP

重新编译python2.7.3,重新撞了paramiko模块和pycrypto

还是报GMP太老

于是再次回到python2.6

下载了argparse模块在python2.6上装

但是报错说没有setuptools模块

于是下载了setuptools模块,装上

再次装上argparse模块

这下,好了,神马都好了





[root@cclove ~]# python26 Python 2.6.8 (unknown, Apr 12 2012,
20:59:36) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type
"help", "copyright", "credits" or "license" for more information.
>>> import argparse >>> import paramiko


啊,脑袋短路不好玩啊,早这么干不就好了啊

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 lsx121924 的頭像
    lsx121924

    lsx121924的部落格

    lsx121924 發表在 痞客邦 留言(0) 人氣()