11

OK. I read installing paramiko on Windows.

All mentioned methods simply do not work.

Authors have different environments with different components/libraries installed. Or may be they don't test their solutions before posting an answer :)

I removed all python versions and libs from my machine (Windows 8 x64) and tried to install python and paramiko from scratch.

Method number 1 (FAILED)

  1. Install python-2.7.3.amd64.msi
  2. Install pycrypto-2.6.win-amd64-py2.7.exe
  3. Download https://github.com/paramiko/paramiko/archive/master.zip, unpack it.
  4. Run setup.py install
  5. Go to IDLE, run import paramiko.

Result:

Traceback (most recent call last):   File "<pyshell#0>", line 1, in
<module>
  import paramiko   File "C:\Python27\lib\site-packages\paramiko\__init__.py", line 65, in
<module>
    from transport import SecurityOptions, Transport   File "C:\Python27\lib\site-packages\paramiko\transport.py", line 45, in
<module>
   from paramiko.ecdsakey import ECDSAKey   File "C:\Python27\lib\site-packages\paramiko\ecdsakey.py", line 24, in
<module>
  from ecdsa import SigningKey, VerifyingKey, der, curves ImportError: No module named ecdsa

Method number 2 (FAILED)

  1. Install python-2.7.3.amd64.msi
  2. Install setuptools-1.4.2.win-amd64-py2.7.exe
  3. Install pip-1.4.1.win-amd64-py2.7.exe
  4. pip install paramiko
  5. Go to IDLE, run import paramiko.

Result:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import paramiko
  File "C:\Python27\lib\site-packages\paramiko\__init__.py", line 64, in <module>
    from transport import SecurityOptions, Transport
  File "C:\Python27\lib\site-packages\paramiko\transport.py", line 33, in <module>
    from paramiko import util
  File "C:\Python27\lib\site-packages\paramiko\util.py", line 33, in <module>
    from paramiko.common import *
  File "C:\Python27\lib\site-packages\paramiko\common.py", line 98, in <module>
    from Crypto import Random
ImportError: No module named Crypto

Method number 3 (SUCCESS)

  1. Install python-2.7.3.amd64.msi
  2. Install pycrypto-2.6.win-amd64-py2.7.exe
  3. Install setuptools-1.4.2.win-amd64-py2.7.exe
  4. Install pip-1.4.1.win-amd64-py2.7.exe
  5. Run pip install ecdsa
  6. Download and extract https://github.com/paramiko/paramiko/archive/master.zip
  7. Run setup.py install
  8. Open IDLE, run import paramiko

Result: no errors

Please, help me to find step-by-step algorithm for installing python and paramiko on clean windows 8 machine. Thanx.

UPD: Solution has been found.

Community
  • 1
  • 1
tmporaries
  • 1,343
  • 7
  • 21
  • 35
  • Use [easy-install to install a binary PyCrypto installer](http://stackoverflow.com/a/11405769/6364) and the rest of Paramiko should fall into place. – George V. Reilly Jan 26 '15 at 01:17

5 Answers5

5

For installing paramiko, Visual Basic Compiler is needed.

First download it from Microcsoft: Microsoft Visual C++ Compiler for Python 2.7

Open the paramiko directory and run python setup.py install . And it will download dependencies from internet; especially pycrypto and installation will be successful.

Rushi
  • 51
  • 1
  • 1
3

You're missing the pycrypto dependency. pip is the easiest way:

pip install pycrypto
pip install paramiko

Alternatively, you can install from source, with:

easy_install ./

(See: https://github.com/paramiko/paramiko)

Yuval Adam
  • 149,388
  • 85
  • 287
  • 384
  • 1) it won't be that easy on win. 2) he did install it with pycrypto-2.6.win-amd64-py2.7.exe (my guess is that is not correct one, but can't check now) – alko Dec 12 '13 at 08:54
  • pycrypto is installed with pycrypto-2.6.win-amd64-py2.7.exe – tmporaries Dec 12 '13 at 08:57
  • Clearly OPs installation *cannot* find pycrypto, so something's messed up. Installing both via pip is the easiest way to make sure both are installed to the same place properly. Yes, even on windows. – Yuval Adam Dec 12 '13 at 09:02
  • @YuvalAdam PyCrypto is a C-extension, it's not so obvious task to compile it for a beginner http://stackoverflow.com/questions/11405549/how-do-i-install-pycrypto-on-windows – alko Dec 12 '13 at 11:30
  • Worked for me on Win10 using python 3.6.0 – Adam893 Oct 03 '18 at 09:23
2

For windows users:

  1. Install Python 2.7.11

  2. Download and install pycrypto win-amd64-py2.7.exe

  3. Now open a command prompt. If you have installed python at the following location:

    c:\Python27 then change directory and go to Scripts directory.

  4. Now type the following command:

    pip install paramiko

enter image description here

That's it, you have successfully installed Paramiko.

Community
  • 1
  • 1
Touchstone
  • 4,794
  • 7
  • 36
  • 47
0
  • For the first sequence you need to install 'ecdsa' with pip because paramiko compilation does not automatically resolve its dependencies (as your working solution)

  • The second failed, as stated already, because you did not install pycrypto before running pip install paramiko. I would recommend to use this option rather than installing from source to enable easier upgrade path using pip. Also pip is the easiest to install using their standalone install script: http://pip.readthedocs.org/en/latest/installing.html

kallel
  • 1
  • 1
0

Also, I faced with the following errors like:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python27-x86\include -IC:\Python27-x86\PC /Tcbuild\temp.win32-2.7\Release_openssl.c /Fobuild\temp.win32-2.7\Release\build\temp.win32-2.7\Release_openssl.obj

_openssl.c

build\temp.win32-2.7\Release_openssl.c(423) : fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory

error: command 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe' failed with exit status 2

missed this file: 'openssl/opensslv.h'

it will be happens because while installation paramiko/cryptography/pyOpenSSL packages, they all needed distribution package of OpenSSL-Win32 with *.lib and headers files like: openssl\opensslv.h

so, after installation appropriate OpenSSL app. version, took from here: http://code.x2go.org/releases/binary-win32/3rd-party/Win32OpenSSL/

and copied all headers from C:\OpenSSL-Win32\include\openssl*.* to C:\Pyhton27\inclide*.*

and copied all libs from C:\OpenSSL-win32\lib to C:\Python27\Lib*.*

paramiko package was installed successfully. ! I hope it will be helpful somebody.:) good luck:)

SergeySD
  • 73
  • 1
  • 7