installing paramiko on Windows

63,698

Solution 1

Looks like your pycrypto installation is broken or not installed.

Try to get a pycrypto for python2.6 installer here and try again after installing it.

http://www.voidspace.org.uk/python/modules.shtml#pycrypto

Solution 2

I tried Vijay's method,but it doesn't work.

I use the method on 'http://kmdarshan.com/blog/?p=3208',it works:

  1. Goto to http://twistedmatrix.com/trac/wiki/Downloads and download the pycrypto package .exe for windows/python2.5. This is needed for running paramiko.

  2. Next, download the paramiko package from http://www.lag.net/paramiko/.

  3. Unzip paramiko to a temporary folder, better if you unzip it to the folder where python is installed.

  4. Go into the folder for paramiko.

  5. Open command prompt and see to it that you have python set as the environment variable.

  6. Run this command python setup.py install

  7. You will get a series of lines of compilation. Just make sure you dont have any error in them. If you have any errors you will need to re compile them again.

  8. Just be be sure everything is alright import paramiko in your program and see.

  9. FYI: paramiko is used for ssh..and so on.

Solution 3

  1. Download paramiko for windows. You get the zip file: www.lag.net/paramiko/

  2. To build it you need the dependency package pycrypto. Again keep in mind you will need a matching version of pycrypto for your Python. This is a built version of Windows so no install is required. http://www.voidspace.org.uk/python/modules.shtml#pycrypto

  3. You could do an easy_install by downloading setuptools but I ran into some issues so I chose to download MinGW tool. This is again an installation and no build is required. http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20110316/

  4. Once you have pycrypto and MinGW installed on your windows machine, just browse to the folder where you extracted the paramiko module from the zip file and issue this command:

    python setup.py build --compiler=mingw32 bdist_wininst

TADA! You are all set to use ssh on your windows machine with Python.

Solution 4

I have installed paramiko onto 64bit Windows 7 successfully:

  1. Install Python2.7
  2. Download 64bit PyCrypto installation package from: http://www.dragffy.com/posts/ython-pycrypto-2-4-1-32-and-64-bit-windows-32x64-amdintel-installers
  3. Download paramiko package from: http://www.lag.net/paramiko/
  4. extract paramiko package
  5. start a command line terminal from the extracted paramiko package, run "python setup.py install"

Solution 5

The actual problem does not seem to be a broken Crypto install but a slightly different one. After installing paramiko and crypto with easy_install on windows I do have crypto installed but not Crypto. I installed the package PyCrypt (which gave an error because I didn't have a C compiler before I installed visual studio express)

Share:
63,698

Related videos on Youtube

fixxxer
Author by

fixxxer

(Your about me is currently blank. Said StackOverflow) SOreadytohelp

Updated on March 23, 2020

Comments

  • fixxxer
    fixxxer about 4 years

    This may sound like a repeated question on SF, but I could not find a clear answer to it, yet.So. I installed Paramiko 1.7 with "setup.py install" command and while running the demo.py program, I got this error:

     Traceback (most recent call last):
      File "C:\Documents and Settings\fixavier\Desktop\paramiko-1.7\demos\demo.py", line 33, in <module>
        import paramiko
      File "C:\Python26\lib\site-packages\paramiko\__init__.py", line 69, in <module>
        from transport import randpool, SecurityOptions, Transport
      File "C:\Python26\lib\site-packages\paramiko\transport.py", line 32, in <module>
        from paramiko import util
      File "C:\Python26\lib\site-packages\paramiko\util.py", line 31, in <module>
        from paramiko.common import *
      File "C:\Python26\lib\site-packages\paramiko\common.py", line 99, in <module>
        from Crypto.Util.randpool import PersistentRandomPool, RandomPool
    ImportError: No module named Crypto.Util.randpool
    

    I'm getting this error even after installing PyCrypto 2.1. On running test.py(which comes with the installation), I got the following error -

        Traceback (most recent call last):
      File "C:\Documents and Settings\fixavier\Desktop\pycrypto-2.0.1\pycrypto-2.0.1\test.py", line 18, in <module>
        from Crypto.Util import test
      File "C:\Documents and Settings\fixavier\Desktop\pycrypto-2.0.1\pycrypto-2.0.1\build/lib.win32-2.6\Crypto\Util\test.py", line 17, in <module>
        import testdata
      File "C:\Documents and Settings\fixavier\Desktop\pycrypto-2.0.1\pycrypto-2.0.1\test\testdata.py", line 450, in <module>
        from Crypto.Cipher import AES
    ImportError: cannot import name AES
    

    I don't have the confidence to go ahead and install AES after all this, for all I know I may get another ImportError! Please advice.Is it the way of installation thats problematic?

    • Dai Doan
      Dai Doan almost 14 years
      From your stack track can we infer that you are trying to do this under Windows? You should edit your question to include this information, as it does influence the answers you will get.
  • Air
    Air over 10 years
    When you provide an external link as your answer you should also copy or summarize the relevant bits into your answer, in case the site you have linked is modified or no longer available later on.
  • lethal-guitar
    lethal-guitar about 10 years
    Please do not post link-only answers. Include the relevant steps in your answer. Also, in the future, please format your answer to make it as readable as possible. Furthermore, this question already has an accepted answer - please make sure you're really adding something that wasn't available before.
  • lethal-guitar
    lethal-guitar about 10 years
    Another thing: Why do you install Python 2.7, when you're actually trying to use Python 3.3?
  • Ptich
    Ptich about 10 years
    lethal-guitar thanks you for edit my post, sorry for my bad english.
  • Ptich
    Ptich about 10 years
    I wrote programs name, but people can find version of library and platform without my assistance
  • Babken Vardanyan
    Babken Vardanyan over 9 years
    If using latest Python 3.4, get pycrypto installer from here: github.com/axper/python3-pycrypto-windows-installer </shamelessplug>

Related