[Tutor] Trouble importing Paramiko

Dave Angel d at davea.name
Thu Dec 27 17:16:13 CET 2012


On 12/27/2012 06:44 AM, Ufuk Eskici wrote:

First comment:  please don't top-post.  You've done it many times now,
and it's not how this forum works.  Put your comments after the parts
you're quoting.

(My email is mostly busted;  I've been trying to send this for hours)

First question:  what version of Python ?  And do you know where it's
installed?  Since you're on Windows, I won't bother to tell you to use
the which command.

Your latest post seems to imply you're using a 2.x version of paramiko,
and trying to install it on Python 3.3

> My code is:
>
> import paramiko
> ssh = paramiko.SSHClient()
> ssh.connect('710.10.10.10', username='ufuk', password='ufuk')
>
> and saved this file as "ufo.py" on the desktop.
>
> I'm still getting error:
>
>>>> ================================ RESTART
> ================================

What's this?  Are you working in some environment other than the command
line?  If you are, then you should make sure it all works on the command
line before trying to separately debug why the IDE (or whatever) is
messing you up.

> Traceback (most recent call last):
>   File "C:\Users\eufuesk\Desktop\ufo.py", line 1, in <module>
>     import paramiko
> ImportError: No module named paramiko
>



Now we're getting somewhere.  Now the questions are where did paramiko
get installed to, and where is python looking for it.

For the former, hopefully you remember what it said when it installed,
or you can search the drive for paramiko.*
     dir /s  \paramiko.*


For the latter, you can add the following line to ufo.py, just before
the import line:

import sys
print "import path is ", sys.path





-- 

DaveA



More information about the Tutor mailing list