tags:

views:

372

answers:

3

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?

A: 

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

S.Mark
A: 

It appears that the Crypto package you downloaded doesn't have AES...

you should try doing the following:

import Crypto
import Crypto.Util
import Crypto.Cipher

if any of those fail then you still need to make sure pycrypto is installed (see the link from S.Mark here), otherwise Paramiko might not depend on having AES (even though there is a test for that)

Terence Honles
A: 

It seems PyCrypto uses a c-compiler(which is inherently present on the Linux system - gcc). Also, somewhere on the PyCrypto readme.txt file says, it needs to be 'build' first, before doing an 'install' On Linux, I build it first and then ran 'install' command on it and was successfully installed.

fixxxer