Module Import Path?

From: Jesse B. (jburns131_at_adelphia.net)
Date: 07/31/04


Date: Sat, 31 Jul 2004 12:42:26 -0700

I have just begun to learn python using o'reilly's Learning Python, and in
chapter 3 it talks about importing modules. It has me make modules to
practice using the 'import' and 'from' statements from the python command
line.

I don't know what directory to save these files in because I'm not sure what
directories 'import' is looking in to find modules. I've done some google
searches trying to find out where the 'import' search path is, but I'm not
familiar enough with python to do a clear enough search. I'd appriciate it
if anyone can help me out or point me in the right direction.



Relevant Pages

  • Re: The Famous Error Message: "ImportError: No module named python_script"
    ... This allows Python programs that know what they're doing to modify or replace the module search path. ... Note that because the directory containing the script being run is on the search path, it is important that the script not have the same name as a standard module, or Python will attempt to load the script as a module when that module is imported. ...
    (comp.lang.python)
  • Re: Newbie: module structure and import question
    ... pretty much demand that users set up the launcher so that your python ... have the installer setup things so other applications can find it. ... should already be in the search path. ... This is not really any different then for example using shared libraries. ...
    (comp.lang.python)
  • Re: Importing modules
    ... to import from the library/module. ... Python has to resolve each dotted name at runtime, ... There is a default library search path that is built relative to the interpreter location. ... You *can* alter the search path by setting some environment variables, ...
    (comp.lang.python)
  • Re: another docs problem - imp
    ... I assume one cause of the misunderstanding was the name "path" for the search path. ... But Python is only following a common standard here. ... Since environment variables are called PATH, CLASSPATH etc. it was only logical to use PYTHONPATH and sys.path etc. ...
    (comp.lang.python)
  • Re: How can I customize builtin module search path to prefix/lib to prefix/lib64?
    ... .pth cannot prepend search path. ... I have to put lib64 before lib/. ... Is it possible to change module search path built-in to ... Python interpreter? ...
    (comp.lang.python)