importing module

Peter Otten __peter__ at
Thu Sep 9 14:51:21 CEST 2010

Holzwarth, Dominique (Berne Branch) wrote:

> Hi all
> Lets assume I have the following structure of directories and python
> modules:
> Root-dir
> |_dir1
>   |_
> |_dir2
>   |_
>   |_sudir2
>      |_
> Is it possible to import script1 into script2 and script3? Or do have to
> put into the Lib\site-packages folder of my Python installation
> so that it'll be in the standard module search path?

You have three options

- put into a directory in python's search path
- modify the PYTHONPATH environment variable to include /path/to/dir1
- add a .pth file in a directory already in python's search path


More information about the Python-list mailing list