win32 python path

John J. Lee phrxy at csv.warwick.ac.uk
Sun Feb 11 17:59:13 EST 2001


On Sat, 10 Feb 2001, John J. Lee wrote:

>
> I'm not sure if this is the same on unix as I'm not near a suitable
> machine ATM, but I get this behaviour on win95:
>
> C:\Python20\Lib\Local.pth
> C:\Python20\Lib\Local\MyModuleDir.pth
> C:\Python20\Lib\Local\MyModuleDir\mymodule.py

No, I mean:

C:\Python20\Local.pth
C:\Python20\Local\MyModuleDir.pth
C:\Python20\Local\MyModuleDir\mymodule.py

and, below, I mean:

C:\Python20\MyModuleDir.pth
C:\Python20\Local\MyModuleDir\mymodule.py

where MyModuleDir.pth contains the single line

Local/MyModuleDir

(Lib is where the _standard_ modules are)

> Where xxxx.pth points to the directory xxxx, of course.  Python doesn't
> see mymodule.py with this set-up, but it does if you have instead:
>
> C:\Python20\Lib\MyModuleDir.pth
> C:\Python20\Lib\Local\MyModuleDir\mymodule.py
>
> which is fine if you only have one locally-installed module, but annoying
> if you have lots.  Why does Python (2.0) do this?  I am aware of the fact
> that Guido is in favour (who knows why) of dumping all locally-installed
> modules in Lib on windows.
>
> I also don't like the way that .pth files are frowned upon.  For example,
> tiny module 'TableIO' has a .so / .DLL _tableio.pyd and a pure python
> module TableIO.py.  It would be nice to have them both in one directory,
> because otherwise files like this will end up scattered over your module
> directory and you won't know which ones belong together.  In this case I
> suppose you could just make a directory TableIO and import with
>
> from TableIO import TableIO
>
> but many modules have a class with the same name as the module, so you'd
> end up with
>
> from TableIO import TableIO.TableIO
>
> which is silly.
>
> Thanks for any help
>
>
> John
>
> "Deprecating .pth's is silly, and does not at at all good things."
>
>




More information about the Python-list mailing list