Hi all,
I’m using the Panda3D setup tool to build binaries of my game. However, its currently failing when it reaches an import statement for pygame. Here is the error message:
Traceback (most recent call last):
File "__main__", line 16, in <module>
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1176, in exec_module
File "pygame", line 38, in <module>
File "os", line 1165, in add_dll_directory
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\laptopname\\gamename\\build\\win_amd64\\Lib\\pygame'
Here is my setup.py:
from setuptools import setup
import os, sysconfig
# Where your venv stores platform libs (packages with .pyd + DLLs)
site_plat = sysconfig.get_paths()['platlib'] # e.g. C:\...\venv\Lib\site-packages
pygame_src = os.path.join(site_plat, 'pygame') # full pygame package path
# Tell build_apps to copy the whole folder into the build at Lib\pygame
include_files = [(pygame_src, 'Lib/pygame')]
setup(
name='game1',
options={
'build_apps': {
'gui_apps': {
'game1': 'Menu.py',
},
'log_filename': '$USER_APPDATA/game1/output.log',
'log_append': False,
'include_patterns': [
'fonts/**',
'images/**',
'models/**',
'sounds/**',
'contact_details',
'questions',
'venv\Lib\site-packages\pygame'
],
# only needed if dynamic imports are used:
'include_modules': [
'game',
'database_interactions',
'pygame',
'pygame.freetype'
],
'plugins': [
'pandagl',
'p3openal_audio',
],
'platforms': ['win_amd64'],
'prefer_discrete_gpu': True,
}
}
)
Any help would be greatly appreciated! Very stuck with this one.
Thanks,
Jack