I have Python 2.5 installed on my machine (Windows) and would like to use it instead of the python that is distributed with Panda. Does anyone know of any issues with using 2.5 versus 2.4 with Panda? Will I have to compile both Panda and Python or should it work out of the box with some tinkering on paths, etc? If it requires only path mods what are they?
In principle, you can compile Panda to work with any version of Python. However, there is a particular fundamental incompatibility with Python 2.5 on Windows.
The problem is that the Python team changed the rule for importing extension modules in Python 2.5. Previously, you could import a .dll or a .pyd file as a Python module (the files are the same except for the extension). Beginning in Python 2.5, for some reason they decided to specifically disallow importing a .dll file; all Python modules must now be named .pyd. The problem is that Panda is compiled to a number of .dll files that serve both as standard Windows dllâs and as Python modules. We cannot name them .pyd, because then Windows will not be able to import them as dllâs. We cannot name them .dll, because then Python will not be able to import them. So we have a problem.
Eventually, we will have to solve this by creating two files: a standard Windows .dll file, as we have now, and a stub .pyd file that can be imported into Python and simply loads in the .dll. Until then, you may have trouble building Panda for Python 2.5.
This problem is specific to Windows. There are no changes to the import rules for non-Windows platforms.
We havenât made this particular problem a priority, so weâve been working on other problems instead, especially as weâve been working on getting our games out the door here at the VR Studio. It will become more important to us in the near future, though.
No, that doesnât work. It loads two copies of the DLL, so you get two copies of each global variable. Not good.
There actually is a way to import a DLL file from python 2.5 - itâs just that âimport libpandaâ doesnât work. You have to use the python import function instead. So that would be the workaround.
There should be a BIG Note on this problem on the download page. I just install panda 1.4.2 for window and wondered why not even the demo programs would run. I am not uninstalling it. and going to try to reinstall and tell it NOT to use the registry key.
Well that did not work. Upon reinstall it does not even prompt you to use the python registry key or not. GRRR can someone PLEASE help me
When you install panda for windows, it also installs a copy of python 2.4 â ie, the right version. If you have a copy of python 2.5 installed too, it doesnât complain, because youâre allowed to have two versions of python installed.
To run panda code, you have to use python 2.4, though â most people use the one included with panda. If you try to use your own python 2.5 instead, it wonât work.
To run the right copy of python, if you have multiple copies installed on your machine, you might have to use an absolute path, ie:
I should also mention that any python-loadable DLL is compatible with only one version of python. Thatâs just the way python works. This website distributes DLLs compiled for python 2.4.
Josh. So just confirm for me i would need to start every panda program with C:\panda3d-1.4.2\python.exe\thepanda3dprogram including the path to itâŚpy From the command line?
I guess my previous question was related to what woudl happpen if the py file is not in C"\Panda3d-1.4.2\python\ But I see it now. Never mind.
I HAVE to switch back to 2.5 Several of my blender plugins will not work with 2.4.4 and I need those
I hope this situation will be corrected soon
Josh I had to go back to python v. 2.5.1 There is a certain script for blender that I have to have that will not run without it.
So I tried your solution of running panda scripts with the version of python 2.4 that comes with Panda directly from the command line. I tried it on one of the samples that come with panda3d 1.4.1 this is the error I got in the cmd box.
C:\Panda3D-1.4.2\samples\Sample-ProgramsâParticles>c:\Panda3d-1.4.2\python\ppyt
hon.exe Tut-Steam-Example.py
âimport siteâ failed; use -v for traceback
DirectStart: Starting the game.
Traceback (most recent call last):
File âTut-Steam-Example.pyâ, line 8, in ?
import direct.directbase.DirectStart
File âC:\Panda3D-1.4.2\direct\src\directbase\DirectStart.pyâ, line 3, in ?
from direct.showbase import ShowBase
File âC:\Panda3D-1.4.2\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