Hi all,
I have to say that I am really enjoying development with Panda3D, it is a great engine. Thanks for all the work that has gone into it.
Excuse my ignorance; this is the first time I’ve used setuptools ![]()
I am trying to generate an .exe for my project using setuptools, but the resulting executable crashes immediately on launch, as shown in the attached log file (at the end of the post). The issue seems to be related to NumPy (2.3.5) and its native libraries. I have tried including NumPy in several different ways, and with different Python/NumPy versions, but it still crashes on startup.
I also tried using the following code in setup.py to include the NumPy libraries, based on a suggestion I found in this forum (although it referred to an older NumPy version), but it does not help or seem to have any effect:
'package_data_dirs': {
'numpy': [('numpy.libs/*', '', {'PKG_DATA_MAKE_EXECUTABLE'})],
},
If I remove all NumPy-related code from my project, the .exe is generated and runs correctly, but the models appear rotated, and I suspect this is caused by panda3d-gltf. The model animations do not play at all. I am using .glb files for my 3D models. Is it mandatory to convert them to .bam files, or should the distributable be able to load .glb files directly?
Does anyone have any idea what might be going on? I am honestly a bit lost, and any help would be greatly appreciated.
Also, this working .exe forces me to place my assets folder inside another folder called “Lib”. Why does this happen? I would prefer to have the assets folder next to the .exe file. Is this configurable?
I have also managed to build the project using PyInstaller, it correctly includes NumPy in the build, but it shows the same issues with model rotations and animations (is panda3d-gltf not being included?). I would prefer to continue using setuptools if possible to build the distributable.
In my project I am using the following libraries (latest versions), and I am running Python 3.13.7:
panda3d
#types-panda3d # this provides type hints for panda3d, it is not needed for release builds
panda3d-gltf
pydantic
json5
imgui-bundle
pyperclip
numba # will install numpy 2.3.5
And also the latest version of setuptools.
My setup.py looks like this at the moment; it still contains some commented-out sections from previous attempts:
from setuptools import find_packages, setup
setup(
name='Whispers',
# packages=find_packages(include=['p3dimgui', 'p3dimgui.*']),
# packages=find_packages(include=['src', 'src.*']),
# setup_requires=["numpy"],
# install_requires=["numpy"],
options={
'build_apps': {
'gui_apps': {
'whispers': 'run_game.py',
},
'log_filename': 'whispers.log',
'log_append': False,
'platforms': [
# 'manylinux1_x86_64',
# 'macosx_10_6_x86_64',
'win_amd64'
],
# Specify which files are included with the distribution
'include_patterns': [
'assets/**',
'src/default_config.json5',
],
'rename_paths': {
'src/default_config.json5': 'default_config.json5',
},
# 'include_modules': [
# # 'panda3d',
# # 'imgui-bundle',
# # 'pyperclip',
# # 'pydantic',
# # 'json5',
# 'numpy',
# 'numpy.core',
# # 'numba',
# ],
'include_modules': [
'panda3d-gltf',
],
'plugins': [
'pandagl',
'p3openal_audio',
'p3assimp',
],
'use_optimized_wheels': False,
'prefer_discrete_gpu': True,
# 'bam_model_extensions': ['.glb'],
# does not seem to work properly with numpy
# 'package_data_dirs': {
# 'numpy': [('numpy.libs/*', '', {'PKG_DATA_MAKE_EXECUTABLE'})],
# },
}
}
)
Everything works perfectly when I run the game from the IDE; only the generated .exe has issues.
These logs contain the latest versions of the dependencies.
Build (python setup.py build_apps) log: Build log - Pastes.io
Game execution log: Game execution log - Pastes.io
Thanks for your time.