先说一下我的环境:
win7 x64 旗舰版、Python3.5.0、pip8.1.0
pip install paramiko时报错如下:
大概意思:
![](https://images2015.cnblogs.com/blog/867021/201603/867021-20160306095423565-1563412564.png)
blablabla...
![](https://images2015.cnblogs.com/blog/867021/201603/867021-20160306095436909-1565289954.png)
反正大概意思就是少GMP or MPIR?
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
上面的问题貌似是C++版本低导致pycrypto安装不成功?(我也不知道,Google一上午都让我装Visual c++)
翻了好多Stack Overflow的答案。。。最后找到一个:
用下面的链接安装解决:(From:=>Github:https://github.com/sfbahr/PyCrypto-Wheels)
pip install --use-wheel --no-index --find-links=https://github.com/sfbahr/PyCrypto-Wheels/raw/master/pycrypto-2.6.1-cp35-none-win_amd64.whl pycrypto
用上面的方式安装pycrypto之后
![](https://images2015.cnblogs.com/blog/867021/201603/867021-20160306102127330-237848587.png)
再使用 pip install paramiko
![](https://images2015.cnblogs.com/blog/867021/201603/867021-20160306102204143-410841148.png)
看到上面的图显示安装成功了。。。
But...
import paramiko的时候又报错了。。。(囧。。。我的一上午啊!!!)
![](https://images2015.cnblogs.com/blog/867021/201603/867021-20160306095549737-777042934.png)
Google到一个解决方法如下,亲测有效:(From:=>Github:https://github.com/dlitz/pycrypto/pull/46)
打开:%PythonHome%Python35Libsite-packagesCryptoRandomOSRNG
t.py 文件
将28行按下面修改:
import winrandom ==> from Crypto.Random.OSRNG import winrandom
问题最终解决:
![](https://images2015.cnblogs.com/blog/867021/201603/867021-20160306095855815-935109292.png)