10

Installing PyCrypto/Paramiko for Python3 x64 Windows

 3 years ago
source link: https://www.devdungeon.com/content/installing-pycryptoparamiko-python3-x64-windows
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Installing PyCrypto/Paramiko for Python3 x64 Windows

Submitted by NanoDano on Sat, 11/28/2015 - 22:32

Paramiko is a great Python library for SSH but it can be a hassle to install in Windows. In this situation, I am using Windows 10 64-bit and Python 3.4.3. Paramiko is available on Pip which helps but it is not the smoothest installation.

First, I run in to an issue with the PyCrypto dependency that it tries to install:

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)

Read this on how to solve that problem: Fix Pip Install Unable to Find vcvarsall.bat

After getting that done and reinstalling with Pip, it appears to install properly. However, when I try to run Python and import paramiko I get an error about winrandom:

ImportError: No module named 'winrandom'

To fix this, you have to go in the source code for the Crypto lib and fix an import statement. In my case, Python was installed to C:\Python34\. The full path of the file I had to change was:

C:\Python34\Lib\site-packages\Crypto\Random\OSRNG\nt.py

In that file, change

import winrandom
from . import winrandom

Now you should be able to run python and import paramiko.

Tags: 

Advertisement


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK