3

I'm working on a SFTP module in python, and have been using Paramiko and Pycrypto (i'm an amateur programmer, bear with me experts). I am building it in 2.7, but the error it gives me doesn't make sense to me because I have all the necessary dependencies:

>>> import paramiko
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\paramiko\__init__.py", line 69, in <module
>
    from transport import SecurityOptions, Transport
  File "C:\Python27\lib\site-packages\paramiko\transport.py", line 32, in <modul
e>
    from paramiko import util
  File "C:\Python27\lib\site-packages\paramiko\util.py", line 32, 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

This baffles me because I have the correct and updated version of pycrypto and minigw installed:

>>>import crypto
>>>

Anyone care to give me a hand?

  • Duplicate of [this post](http://stackoverflow.com/questions/7210873/from-crypto-import-random-importerror-cannot-import-name-random)? If not it may help anyway. – bbayles Jul 26 '13 at 17:40

2 Answers2

1

To me, the problems seems to be that "paramiko" is trying to import the module "Crypto" (notice the capital letter), while you have a module named "crypto" installed.

papafe
  • 2,959
  • 4
  • 41
  • 72
  • I did a "pip install Crypto", but it says I have it already installed. But when I tried to import it I got a "No module named Crypto". – ShotGunHero Jul 26 '13 at 18:00
0

Check inside your Lib\site-packages\pycrypto folder. There might be a further Lib\site-packages\Crypto. Copy/pasting Crypto in with the rest of my installed packages did the trick for me.

moarCoffee
  • 1,289
  • 1
  • 14
  • 26