Python Win installations and PYTHONPATH Confusion (WAS: Re: Python Path Blues)

Maan M. Hamze mmhamze at pleiades.net
Fri Aug 17 11:43:30 EDT 2001


What is important here is that this can be a BIG turn-off for beginners.
It took me more than a day of tinkering with the registry while trying to
make DCOracle2 and mxODBC packages for Python run correctly.  Then I
discovered it was all a matter of adding PYTHONPATH into the environment in
Win NT and Win ME (for Win ME through running msconfig  then going to
Environment tab or creating a PYTHONPATH setting in autoexec.bat which
updates the Win ME environment).
Of concern:
1.  Upon installing Python (PythonWin or the regular Python distribution for
Windows), the registry itself is updated with the lib path, but NO
PYTHONPATH setting is created in the environment.  This is MISLEADING, since
it appears that every other thrid party package is using this environment
setting.  If it is surprising Tim Peters :) I do not know how new comers to
Python would figure something like this out.
2.  I noticed that Python for Win installation adds Class ID's to the
default Library paths in the registry.  Why?  Other packages do not add
these class id settings, and they depend on the PYTHONPATH environment.
Treating the default installation libs differently should not be
recommended.  Also, what is the reasoning behind these class id entries for
these default lib paths?
3.  All this is leading to a PYTHONPATH setting in the registry, and a
PYTHONPATH setting in the environment.  Do they have to be in synch?  Such
behaviour is a trademark of Microsoft mentality - identity crisis, and
confusion.  Please, let us keep Python immune from such confusing
behaviours.
4.  Mark Hammond:  If you are reading this - what is going on, and how these
settings are related?
Maan

"Tim Peters" <tim.one at home.com> wrote in message
news:mailman.998008948.12318.python-list at python.org...
> [Maan M. Hamze]
> > Issue resolved.
> > Although the search path is set in the windows NT registry, I discovered
> > that it was not set in:  My Computer ..... Properties .... Environment.
> > I truly thought that the registry was enough, but apparently it is not.
> > Having set the PYTHONPATH in the environment the problem was resolved.
> > Strange:  What is the point of the registry then?
>
> I'm not sure, it hasn't always been this way, and *all* behaviors for
> PYTHONPATH have surprised me since I first used Python on Windows.  Mark
> Hammond has a Design here, but the only clues I know of as to exactly what
> it is are hiding in comments attached to bug reports on SourceForge.  If
you
> figure it out, please submit a doc patch <0.7 wink>.
>
> cheerfully y'rs  - tim
>
>





More information about the Python-list mailing list