[Tutor] how to control putty window

Dave Angel d at davea.name
Thu Dec 27 11:32:46 CET 2012


On 12/27/2012 04:53 AM, Ufuk Eskici wrote:
> It seems it is looking for Paramiko under wrong folder.
>
>>>> import paramiko
> Traceback (most recent call last):
>   File "<pyshell#3>", line 1, in <module>
>     import paramiko
>   File "C:/Users/eufuesk/Desktop\paramiko.py", line 3, in <module>
>     ssh = paramiko.SSHClient()
> AttributeError: 'module' object has no attribute 'SSHClient'
>>>> os.chdir("c:\\Python27")
>
> Which directory should I use?
>

Looks to me like you're testing it with a script file called
paramiko.py     So when you import paramiko, it's finding your script
instead of the installed paramiko.  Even in the best of times, importing
a module with the same name as your script is problematic.  But in this
case, you're completely masking the actual module.

So rename your script and move it somewhere other than the desktop. 
Start a cmd box (DOS window), and run

c:>  cd sourcedir
c:>  python mytest.py


Another comment:  when starting a new thread, please use a fresh email
to tutor at python.org.  Don't use reply to an existing message, or your
query can get lost in the noise.  And of course pick a subject line that
matches your query, like  "Trouble importing paramiko"


-- 

DaveA



More information about the Tutor mailing list