[Pythonmac-SIG] import question

Chris Barker Chris.Barker at noaa.gov
Thu Nov 6 07:11:28 EST 2003


Scott Frankel wrote:

>  From my script, I get an "ImportError: no module named foo" from this
>         import foo
> which exists and is executable in /usr/local/my_stuff/py_modules.

I've nothing to add to Bob's note, except that foo.py does not have to
be executable, jsut readable....and it is named "foo.py", not just "foo"
isn't it?

you can also do a:

print sys.path to see if Python has got the right path.

Personally, like Bob, I have never used PYTHONPATH, on OS_X or Linux.

-Chris


-- --
Christopher Barker, Ph.D.
Oceanographer
                                                
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the Pythonmac-SIG mailing list