python - 导入错误 : DLL load failed: %1 is not a valid Win32 application - paramiko

标签 python windows python-2.7 64-bit paramiko

我在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。

  1. pip install --upgrade paramiko

    *如果您在升级过程中遇到此错误:

    AttributeError: 'str' object has no attribute 'rollback', do:

    1. pip卸载pycrypto并输入(y)

    2. pip 安装 pycrypto

    3. pip 安装 ecdsa

基本上,只需尝试运行第一个命令,然后按照回溯来解决缺少的任何依赖项。这对我有用。

如果您需要它作为引用,我将我的 session 保存在 txt 中。

-丹尼尔

关于python - 导入错误 : DLL load failed: %1 is not a valid Win32 application - paramiko,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21036760/

相关文章:

python - Django 模板上的 Unicode 字符串显示

python - 链中存在多个一对多映射的长链存在查询

python - 尝试编写一个模拟手机拨号的函数

python - Py2exe 添加包(例如 Carbon)到 exe

python - 安装 Mac 版 TortoiseHg : No module named mercurial

c++ - Python C API 和 C++ 函数

mysql - azure 简单表自定义 api

Windows 中的 Ruby 多行反引号执行不起作用

c - Linux 原生 C 库 : How to configure Visual Studio Code to work with them on Windows?

python - 将汽车制造商型号年份国家/地区添加到字典中