网络编程
位置:首页>> 网络编程>> Python编程>> windows下python安装paramiko模块和pycrypto模块(简单三步)

windows下python安装paramiko模块和pycrypto模块(简单三步)

作者:快递小可  发布时间:2021-11-29 01:18:40 

标签:python,paramiko模块,pycrypto模块

前言

Python中使用SSH需要用到OpenSSH,而OpenSSH依赖于paramiko模块,而paramiko模块又依赖于pycrypto模块,因此要在python中使用SSH,我们需要先安装pycrypto模块,然后再安装paramiko模块。下面话不多说了,来一起看看详细的介绍:

安装方法

1》首先要确保python安装好,且环境变量设置好。(关于python的安装,本文不再赘述。)

2》安装pycrypto:

到下面这个网站下载编译好的pycrypto(也可以自己到官网下载pycrypto,然后编译,但这样会比较麻烦,过程中也容易出问题)

http://www.voidspace.org.uk/python/modules.shtml

大家也可以通过以下链接进行下载:

PyCrypto 2.6 for Python 2.6 windows 32位 : https://www.jb51.net/softs/564267.html

PyCrypto 2.6 for Python 2.6 windows 64位 : https://www.jb51.net/softs/564270.html

PyCrypto 2.6 for Python 2.7 windows 32位 : https://www.jb51.net/softs/564274.html

PyCrypto 2.6 for Python 2.7 windows 64位  : https://www.jb51.net/softs/564279.html

PyCrypto 2.6 for Python 3.2 windows 32位  : https://www.jb51.net/softs/564284.html

PyCrypto 2.6 for Python 3.2 windows 64位 :  https://www.jb51.net/softs/564288.html

PyCrypto 2.6 for Python 3.3 windows 32位  : https://www.jb51.net/softs/564290.html

PyCrypto 2.6 for Python 3.3 windows 64位  : https://www.jb51.net/softs/564293.html

安装完成后,执行如下操作,没有报错,则表示安装成功; 注意导入模块时的大小写,如果首字母写成小写,会出错!!!


>>> import crypto #首字母写成小写,会出错
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import crypto
ImportError: No module named crypto
>>> import Crypto
>>>

3》安装paramiko:

cmd下执行:pip install paramiko

【使用pip进行安装,需要事先安装pip;关于pip的安装,本文不再赘述。如有需要的朋友们可以参考这篇文章:https://www.jb51.net/article/107473.htm】

安装完成后,执行如下,不报错,则表示安装成功:


>>> import paramiko
>>>

来源:http://blog.csdn.net/sxingming/article/details/53055821

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com