Panda3D 1.4.0 - Conflict with Python 2.5 (Bug?)

Hi,
I wanted to try the new Panda3D version. But I get into the following problem:

When I tried to start the Greeting Card from the program group the console closes after a short time - and nothing else appears. Being curious what the reason could be I tried the command promt:

D:\Panda3D-1.4.0\samples\GreetingCard>ppython GreetingCard.py
'import site' failed; use -v for traceback
DirectStart: Starting the game.
Traceback (most recent call last):
  File "GreetingCard.py", line 1, in ?
    import direct.directbase.DirectStart
  File "D:\Panda3D-1.4.0\direct\src\directbase\DirectStart.py", line 3, in ?
    from direct.showbase import ShowBase
  File "D:\Panda3D-1.4.0\direct\src\showbase\ShowBase.py", line 10, in ?
    from pandac.PandaModules import *
  File "pandac\PandaModules.py", line 5, in ?
  File "pandac\libp3directModules.py", line 12, in ?
  File "direct\src\directnotify\DirectNotifyGlobal.py", line 3, in ?
  File "direct\src\directnotify\DirectNotify.py", line 5, in ?
  File "direct\src\directnotify\Notifier.py", line 6, in ?
  File "direct\src\showbase\PythonUtil.py", line 40, in ?
  File "C:\Python25\lib\random.py", line 41, in ?
    from warnings import warn as _warn
  File "C:\Python25\lib\warnings.py", line 264, in ?
    simplefilter("ignore", category=ImportWarning, append=1)
NameError: name 'ImportWarning' is not defined

As it seems - there seems to be a conflict with my installed Python 2.5 version. But since I need this version for other things (for example Blender), I can’t simply uninstall this version.

After that I tried installing and running Airblade 1.4.0. This also doesn’t work (as expected) - surely the same problem.

I’m using Win XP Home. Python 2.5 is installed. It seems to be important to me to note for your reproducability of the bug that I set the following environment variable (Blender3D requires it):

PYTHONPATH=C:\Python25\Lib\idlelib;C:\Python25;C:\Python25\DLLs;C:\Python25\lib;C:\Python25\lib\plat-win;C:\Python25\lib\lib-tk;C:\Python25\lib\site-packages

Interestingly Python 2.5 is not in my PATH (so when I start python from the command prompt by typing python the version of Panda3D starts).

I hope this information helps you to reprocude and hopefully fix this bug.

You must have the old version of Panda3D still installed, because, in Panda3D 1.4.0, there is no ppython anymore. Try uninstalling the old version and running with python instead of ppython.

It exists on my install at C:\Panda3D-1.4.0\python\ppython.exe

(edited)

In the windows version, there’s still a residual ‘ppython.’ It doesn’t do anything different than just ‘python’.

I see that the PYTHONPATH is definitely the problem. Interesting.

I wonder what we should do about this. On one hand, I could force it to ignore PYTHONPATH. On the other hand, PYTHONPATH is a useful tool — ignoring it would not be very nice to the people who actually use it.

Oh! I see that python has a command-line option, -E : ignore pythonpath. For now, you can use this option explicitly to run panda programs. I should insert this command-line option into all the start-menu links.

@Josh Yelon

This trick works. Thank you.