我在win7 64位有一个情况,我用easy_install paramiko安装paramiko 1.12.1后,我用的是64位的python2.7,还安装了64位的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.
有什么想法吗?
最佳答案
这也是我遇到的问题。我有 Windows Server 2012 64 位和 python 32 位。我最终做的是让 pip 解决所有问题。 我有 pip 1.6.dev1。
pip install --upgrade paramiko
*如果您在升级过程中遇到此错误:
AttributeError: 'str' object has no attribute 'rollback', do:
pip卸载pycrypto并输入(y)
pip 安装 pycrypto
pip 安装 ecdsa
基本上,只需尝试运行第一个命令,然后按照回溯来解决缺少的任何依赖项。这对我有用。
如果您需要它作为引用,我将我的 session 保存在 txt 中。
-丹尼尔
关于python - 导入错误 : DLL load failed: %1 is not a valid Win32 application - paramiko,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21036760/