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

Benjamin Kaplan benjamin.kaplan at
Mon Jan 18 03:15:50 CET 2010

On Sun, Jan 17, 2010 at 8:09 PM, Jive Dadson <notontheweb at> wrote:
> 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 into the directory Modules, and it will load
> when I say "import foo."
> Now I put a folder into Modules called myModule and in that I put
>  It does not find when I say either import bar or import
>  I tried the myModule.pth trick but it didn't help.  Maybe I
> did it wrong.

Just put a blank file called inside myModule

In Python, packages have to have an file in them, even if
it's empty. Whatever you put in gets imported when you
"import myModule".

> --

More information about the Python-list mailing list