windows python Install paramiko module and pycrypto module (three easy steps)

  • 2020-06-07 04:48:16
  • OfStack

preface

Using SSH in Python requires OpenSSH, while OpenSSH relies on the paramiko module, and the paramiko module relies on the pycrypto module, so to use SSH in python, we need to install the pycrypto module first, and then the paramiko module. Without further ado, let's start with a detailed introduction:

Installation method

1. First make sure that python is installed and environment variables are set. (The python installation will not be covered in this article.)

2) Installation pycrypto:

Download the compiled pycrypto from the following website (you can also download pycrypto from the official website yourself and then compile it, but this will be troublesome, and problems may occur during the process)

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

You can also download it from the following link:

2.6 for PyCrypto Python windows 32-bit 2.6: https: / / www ofstack. com softs / 564267. html

2.6 for PyCrypto Python windows 2.6 64: https: / / www ofstack. com softs / 564270. html

2.6 for PyCrypto Python windows 32-bit 2.7: https: / / www ofstack. com softs / 564274. html

2.6 for PyCrypto Python windows 2.7 64: https: / / www ofstack. com softs / 564279. html

2.6 for PyCrypto Python windows 32-bit 3.2: https: / / www ofstack. com softs / 564284. html

2.6 for PyCrypto Python windows 3.2 64: https: / / www ofstack. com softs / 564288. html

2.6 for PyCrypto Python windows 32-bit 3.3: https: / / www ofstack. com softs / 564290. html

2.6 for PyCrypto Python windows 3.3 64: https: / / www ofstack. com softs / 564293. html

After the installation is completed, perform the following operation. If no error is reported, the installation is successful. Note the case when importing the module, if the first letter is written in lowercase, an error will occur!!


>>> import crypto # Start with a lowercase letter and you'll make an error  
Traceback (most recent call last): 
 File "<pyshell#0>", line 1, in <module> 
 import crypto 
ImportError: No module named crypto 
>>> import Crypto 
>>> 

3) Installation paramiko:

Under cmd: pip install paramiko

【 use pip for installation, need to install pip beforehand; about pip installation, this article is no longer here. If you have any need friends can refer to this article: https: / / www ofstack. com article / 107473. htm 】

After the installation is completed, execute the following. If no error is reported, the installation is successful:


>>> import paramiko
>>> 

conclusion


Related articles: