import problems *newbie*

mike kreiner mike.kreiner at gmail.com
Fri Jan 14 00:58:36 EST 2005


I am having trouble importing a module I created. I'm running PythonWin
on Windows XP if that helps. I saved my module in a folder called
my_scripts in the site-packages directory. I edited the python path to
include the my_scripts folder (it now reads
C:\Python23\Lib;C:\Python23\DLLs;C:\Python23\Lib\lib-tk;C:\Python23\Lib\site-packages\my_scripts).
When I try to import the module, I get this error:

>>> from PolyDraw import *
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
ImportError: No module named PolyDraw

When I select Browse PythonPath from the tools menu, I'm able to locate
my module, PolyDraw.py.

The problem goes away if I open PolyDraw.py from PythonWin, which I'm
assuming is because opening the module makes my_scripts the current
working directory. This is just a quick workaround, but I'd like to
know how to fix the problem. Thanks.

-Mike




More information about the Python-list mailing list