Migration to Python 3


#61

Ok, so I’ve tried numerous build combinations using 32 and 64 bit, with both versions of python, and no combination works, even the 3 buildbot installers I tried (488, 460, 346) all produce the same error. Doing everything identically with the 1.8.1 installer works fine, so it seems to be something with the 1.9 branch in general that’s not working for me.

I’ll give your suggestion a try and see if it yields anything.


#62

Ok, I’ve essentially solved the problem. It turns out that for some reason, even though the PATH variable is being set correctly, Windows just can’t find the panda .dlls for any 64 bit installation of panda3d. If I copy the dlls to the “windows/sysWOW64” folder then the .pyd imports work without issue. I don’t have this issue with the 1.8.1 installation but still I’m not sure if the problem is on my end or in the 1.9 branch. I wonder if anyone else has had this problem on Win7 with 64-bit builds?

Anyways I’m going to start porting my project to python 3 so I’ll let you know if I encounter any issues. A couple of other things that may or may not be related to the problem I was having:

i) I have to trick makepanda.bat into performing a 64-bit build because the “AMD64” test always fails even though I am running 64bit and I’m putting a 64bit build of python in the thirdparty folder.

ii) Even though it looks like py2to3 is running at the start of the build the resulting direct folder that the installer makes needs py2to3 run on it again before it actually works.


#63

i) That’s odd. What is %PROCESSOR_ARCHITECTURE% set to for you in the shell?

ii) Glad you brought that up! It turns out that the installer doesn’t grab its direct tree from built/direct but directly from direct/src.

I’ve checked in a fix to packpanda.nsi - would you mind grabbing the latest version and trying again? When you do, please manually delete your C:\Panda3D-1.9.0-x64 directory before installing to make sure I didn’t miss anything. Thanks!


#64

Yeah, I’ll give that a try in the next couple of days. My %PROCESSOR_ARCHITECTURE% is “AMD64”, but I wonder if it’s because I’m using a 32-bit version of Console2 to run makepanda, etc?


#65

I tried another build with the new packpanda.nsi and the py3 conversions worked as expected. The only other issue I’ll note is that makepanda expects a pythonXX.dll to be in the python folder but the python 3 series puts that dll directly into the “windows/sys32” folder (even for 64-bit builds which is odd) so that has to be copied from there into the “thirdparty/python-x64” folder before it will build.

Otherwise I’ve been using python 3 successfully with my panda3d project for the past few days without any problems (other than that initial issue of having to copy the panda dlls directly into the ‘window/sysWOW64’ folder.)


#66

Great! For the record, the Python installer installs the Python DLL into the Python directory instead of system32 when you tick “Install for this user only”.

On 64-bit Windows, system32 is the directory where 64-bit libraries live. The 32-bit libraries live in syswow64. That’s Microsoft logic for you. :unamused:


#67

Hello,
I’ve recently stumbled onto this project and was wondering what the process would be to get a python 3 version of panda3d working with the current git version (as far as python3 works right now)
Is it enough to just install a version of python3 into the win-python folder? Can I use an existing installation of python 3? Will I need the conversion script mentioned in the thread? Or is that run automatically on build?


#68

To build Panda with Python 3, just install Python 3 on your system (choose “install for this user only”) and then copy it into the win-python or win-python-x64 directory. Might want to copy python.exe to ppython.exe and pythonw.exe to ppythonw.exe so that you get the familiar “ppython.exe”. Then build panda3d the usual way, running something like:

makepanda/makepanda.bat --everything --installer --no-eigen

Alternatively, you can use this semi-recent build I uploaded on April 13th 2015.
rdb.name/Panda3D-1.9.0-py3.4-x64.exe

When installing the Panda3D SDK, if the installer detects a compatible existing installation of Python, it will ask you whether it should plop a .pth file in the site-packages dir of that installation so that you can use Panda3D with that Python installation.


#69

I did some work so that the buildbot can make Python 3.4 builds. Here are two 1.10 dev builds from yesterday:
buildbot.panda3d.org/downloads/8 … 97a5fcb5b/


#70

I made Python 3.5 builds, anyone willing to test them?
panda3d.org/download.php?pl … =devel&sdk
Look for the ones with “py3.5” in the filename.


#71

I’m pleased to announce that we no longer run 2to3 on the direct tree. It has been ported to the subset of Python that works under both Python 2 and 3. However, I really need people to test both the Python 2 and 3 build to see if there were any regressions during porting.