How to install local module other than in "site-packages"?

Jive Dadson notontheweb at noisp.com
Mon Jan 18 02:09:35 CET 2010


Okay, I might go this route anyway.  It's almost working.

I created a directory (folder in MS-speak) named Modules, and put its 
path in the PYTHONPATH env variable.

I can now put a file foo.py into the directory Modules, and it will load 
foo.py when I say "import foo."

Now I put a folder into Modules called myModule and in that I put 
bar.py.  It does not find bar.py when I say either import bar or import 
myModule.bar.  I tried the myModule.pth trick but it didn't help.  Maybe 
I did it wrong.



More information about the Python-list mailing list