Hi this is mostly for rdb regarding an attempt to migrate Panda to Python 3, but if anyone has something useful to add feel free obviously.
I managed to get all the installation stuff set up correctly using the latest CVS and replacing the python 2 dist with python 3.3 in the “win-python” folder. I tried 3.2 first but the python installer refused to do anything but offer to alter my existing installation, so I went with 3.3. If this is a problem I’ll just swap them around before I start any serious work on this.
I tried building with “makepanda\makepanda.bat --everything --installer” just to see how far it would get. The first attempt crashed with Maya2010 being the culprit. Adding " --no-maya2010" got me through the Panda build part, but predictably it failed when it got to the python code generation stage:
[ 92%] Generating 'pandac' tree Traceback (most recent call last): File "direct\src\ffi\jGenPyCode.py", line 74, in <module> from direct.ffi import DoGenPyCode ImportError: cannot import name DoGenPyCode
What this unhelpful error msg is actually trying to say is that python 3 enforces absolute imports when using “import” directly, so for example in DirectNotifyGlobal.py (which is actually where the first error occurs, not jGenPyCode.py):
import DirectNotify # fails. # Must be absolute: import direct.directnotify.DirectNotify as DirectNotify # works.
I went through and fixed a few by hand just to see how far I’d get and I eventually began to run into some other errors related to version as expected. I guess this would be my starting point then? But I’m a bit confused as to what code is auto generated and what code I would be working with exactly. I’m presuming that altering the direct tree directly would be pointless since the build process would just regenerate it? I also notice that there is a src folder in the direct tree which duplicates the code which is what the compiler actually invokes. I didn’t really look into this that much, but maybe you could point me in the right direction here. Thanks.