这篇文章是告诉大家如何安装paramiko模块,是学习paramiko模块的前提条件,供大家参考。
需求:
(1)platforms supported: POSIX (Linux, Solaris, BSD, etc.); MacOS X; Windows
(2)python 2.3: python 2.2 is also supported, but not recommended.
(3)pycrypto 1.9+: pycrypto 2.0 has been tested too.
下载:
(1)pycrypto-2.0.1
(2)paramiko
安装:
(1)pycrypto-2.0.1
tar pycrypto-2.0.1.tar.gz &&cd pycrypto
python setup.py install
(2)paramiko
Tar paramkio-n.n.n.tar.gz&&cd paramkio-n.n.n
python setup.py install
测试:
执行python test.py(在paramiko的目录下)
[root@databak paramiko-1.7.6]# python test.py
........................................................................................................... 9s 9s ......... 5s 1s ......... 13s ......... 5s ......... ........ ......... ......... ...
----------------------------------------------------------------------
Ran 108 tests in 129.948s
OK
出现这样的就表示成功了,我们再测试一把。
[root@databak paramiko-1.7.6]# python
Python 2.4.3 (#1, Sep 3 2009, 15:37:12)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
>>>
呵呵,这样就安装成功了。可以借助这个模块写一些小的东东了。
本文转自hahazhu0634 51CTO博客,原文链接:http://blog.51cto.com/5ydycm/340843,如需转载请自行联系原作者