我在win7 64bit的情况下,在我使用easy_install paramiko安装paramiko 1.12.1后,我使用的是64位python2.7,还安装了64bit pycrypto,有一个导入错误:
>>> import paramiko
enter code hereenter code hereTraceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import paramiko
File "build\bdist.win-amd64\egg\paramiko\__init__.py", line 65, in <module>
File "build\bdist.win-amd64\egg\paramiko\transport.py", line 33, in <module>
File "build\bdist.win-amd64\egg\paramiko\util.py", line 33, in <module>
File "build\bdist.win-amd64\egg\paramiko\common.py", line 98, in <module>
File "c:\users\yapan\appdata\local\temp\easy_install-6upp3i\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\__init__.py", line 28, in <module>
File "c:\users\yapan\appdata\local\temp\easy_install-6upp3i\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\__init__.py", line 34, in <module>
File "c:\users\yapan\appdata\local\temp\easy_install-6upp3i\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\nt.py", line 28, in <module>
File "c:\users\yapan\appdata\local\temp\easy_install-6upp3i\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\winrandom.py", line 7, in <module>
File "c:\users\yapan\appdata\local\temp\easy_install-6upp3i\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\winrandom.py", line 6, in __bootstrap__
ImportError: DLL load failed: %1 is not a valid Win32 application.
有没有?
答案 0 :(得分:5)
这也是我遇到的问题。我有Windows Server 2012 64位和python 32位。我最终做的是让pip解决所有问题。 我有点1.6.dev1。
pip install --upgrade paramiko
*如果在升级过程中出现此错误:
AttributeError:'str'对象没有属性'rollback',执行:
pip uninstall pycrypto并输入(y)
pip install pycrypto
pip install ecdsa
基本上,只需尝试运行第一个命令,然后按照回溯来解决缺少的依赖项。这对我有用。
如果您需要参考,我将会话保存在txt中。
-Daniel
答案 1 :(得分:1)
如果您在构建和安装依赖于已编译C模块的Python 2.7组件时遇到问题,我强烈建议您查看Microsoft的Python 2.7专门打包的编译器,这里:
http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
我在使用pycrypto安装Windows 7 64位时遇到了各种麻烦(我试图让Fabric工作,这取决于依赖于pycrypto的paramiko)。安装上述编译器后再执行:
pip install wheel
pip uninstall pycrypto paramiko
pip install paramiko
一切都刚刚开始起作用!希望将来可以帮助任何人从Google获得这个答案。