ImportError: DLL load failed: %1 is not a valid Win32 application - paramiko
Question: I have a situation in win7 64bit, after I installing paramiko 1.12.1 by using
easy_install paramiko,I'm using 64bit python2.7 , also installed 64bit
pycrypto, there is a import error：

    
    
       >>> 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.
    

Any thoughs?


Answer: This is a problem I ran into as well. I have Windows Server 2012 64 bit and
python 32 bit. What I ended up doing is letting pip solve everything. I have
pip 1.6.dev1.

  1. pip install --upgrade paramiko

*if you get this error during upgrade: 

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

    1. pip uninstall pycrypto and enter (y)

    2. pip install pycrypto

    3. pip install ecdsa

Basically, just try to run that first command, and follow the tracebacks to
resolve whatever dependency is missing. This worked for me.

I saved my session in txt if you need it for reference.

-Daniel

