[Tutor] Lost Modules?

Jeff Childers jchilders@smartITservices.com
Mon, 26 Aug 2002 08:56:59 -0400


Hi Gus,

Whew, thanks for the pointer. I'm not so much pulling my hair out now -- it
can be very frustrating to fail at the most simple tasks when trying to
learn a new language. Makes you want to just go back to your old language...
:)  Anyway, onward ho!

Regards (and thanks again),

Jeff

-----Original Message-----
From: Gus Tabares [mailto:gus.tabares@verizon.net]
Sent: Saturday, August 24, 2002 1:57 PM
To: J. Childers
Subject: RE: [Tutor] Lost Modules?


Hello,

 You can set your PYTHONPATH to include whatever directory you're importing
modules from so python knows where to grab them. Assumming you're working
under Win9x, under MS-DOS try typing this:

	set
PYTHONPATH=.,c:\python\lib;c:\python\lib\tkinter;c:\whateverdiryouwant

That should settle your importing problem. If not, let me know:)

Hope this helps,
Gus

-----Original Message-----
From: J. Childers [mailto:jchilders_98@yahoo.com]
Sent: Saturday, August 24, 2002 10:37 AM
To: Gus Tabares
Subject: RE: [Tutor] Lost Modules?


Hi Gus,

It seems I needed to learn how to sys.path.append( os.getcwd()). I had been
assuming that by using
os.chdir(dir) Python would find my working files in the os.getcwd()
location. Not so apparently.

Would changing PYTHONPATH include my working directory in the default path?
(with the method above
I have to change it each time I start a new session). How do I find my
PYTHONPATH?

Thanks Gus,

Jeff

--- Gus Tabares <gus.tabares@verizon.net> wrote:
> Hello,
>
>   What is your PYTHONPATH set to?
>
>
> Gus
> -----Original Message-----
> From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
> J. Childers
> Sent: Friday, August 23, 2002 3:11 PM
> To: tutor@python.org
> Subject: [Tutor] Lost Modules?
>
>
> Hi,
>
> I am at my wits end trying to learn Python. When I create a module
> ("mymod.py") and then try to
> import it, Python tells me it cannot find a module of that name.
>
> "Import can't find module, or can't find name in module: No module
> named mymod"
>
> Yet it is there, in the directory named in os.getcwd(). What the heck am I
> doing wrong? This
> behavior is consistent for any modules I create. Arg!
>
> Jeff
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com