Packaging a panda3d application with wxPython

Hi, I have written a wxPython application which uses panda3d. I am now trying to get it packaged using either setuptools or pyinstaller. (If anyone knows a different multiplatform way to do this I’d like to know about it.)

For setuptools, I have tried including the line “wxPython” in requirements.txt (so there are two lines, the other line is “panda3d”) but this fails with the error “ERROR: Could not find a version that satisfies the requirement wxPython”. The error is the same whether I run setup.py in linux or in Windows. Is there a way to include wxPython as a required package in setuptools? (More generally, I have found no documentation about specifying required packages other than panda3d.)

pyinstaller, running on a Windows 10 virtual machine, seems to work but it doesn’t read my Config.prc (which has “load-display p3tinydisplay” so the program can run with software rendering) so the packaged executable fails to find a graphics pipeline. I have tried copying the correct Config.prc to the directory where the main python file is and also to the directory where I run pyinstaller, but this had no effect. Does anyone know where pyinstaller looks for Config.prc?

Thanks for any help. – Dan

Hi, welcome to the community!

Adding wxPython to the requirements.txt file is the correct approach. However, for our deployment system to work, it requires the thirdparty package in question to publish wheel files for every platform that is being targeted by your application.

Unfortunately, wxPython does not publish wheels for Linux, so Panda will fail to build your application for Linux if you have this dependency. You will want to adjust your platforms in setup.py to target only Windows and macOS, like so:

    platforms=["win_amd64", "macosx_10_9_x86_64"],

(You may adjust 10_9 to 10_6 to target older versions of macOS, but this will force it to use an older version of wxPython.)