location of home made modules

Frank V. Castellucci frankc at colconsulting.com
Mon May 15 20:39:20 EDT 2000


William Park wrote:
> 
> On Mon, May 15, 2000 at 10:01:28PM +0000, Huaiyu Zhu wrote:
> > What is the standard place to put one's home-made modules?
> > How to get Python to know that place?  I tried to put modules in
> > ~/lib/python/ with the following in ~/.pythonrc
> >
> > import sys, os
> > sys.path.append("%s/lib/python" % os.environ["HOME"])
> >
> > This works in the interactive interpreter but does not get the module from
> > program files.  Previously all my modules stay in the same directory as the
> > programs that load them so this problem did not manifest itself.
> >
> >
> > I can't find where in the docs this is mentioned.
> > Thanks for any pointer.
> >
> > --
> > Huaiyu Zhu                               hzhu at knowledgetrack.com
> 
> Use environment variable
>     PYTHONPATH=~/lib/python
> or put the module in
>     /usr/local/lib/site-python/...
> 
> Python online doc explain this.  Search for 'PYTHONPATH' or
> 'site-packages' or 'site-python'.
> 
> --William

Or put a link in /usr/lib/python/site-packages/ to where you modules
reside.

-- 
Frank V. Castellucci
http://corelinux.sourceforge.net
OOA/OOD/C++ Standards and Guidelines for Linux
http://PythPat.sourceforge.net
Pythons Pattern Package



More information about the Python-list mailing list