Startup problems with Python 3.1.2 and PythonPath under XP

Martin v. Loewis martin at
Mon Apr 12 23:12:19 CEST 2010

tkpmep at wrote:
> I fixed the problem by creating a file call MyPath.pth that has only
> one line
> H:/Python
> and placing it in the C:\Python31\Lib\site-packages directory. So as a
> practical matter, my problem is solved. That said, I'm still puzzled
> by why Python 3.1 acts up when I set the environment variable
> PYTHONPATH. It certainly caused no problem with the 2.X series.

Most likely, H:\Python contains a module with a name that conflicts with
the standard library. Starting IDLE tries to import that module - but
not from the standard library, but your own version. That module then
(of course) fails to work correctly. By putting in a pth file, h:\python
is *appended* to sys.path, not prepended.

However, the real fix is not to use module names that conflict with the
standard library.

Run in a cmd.exe shell window to find out what the true cause of
the problem is.


More information about the Python-list mailing list