Hello everyone, how are you?
I’ve been stuck for some time trying to compile with setuptools. I’ve tried several approaches, but each time I get a different error.
I’m trying to compile a version of the old Toontown that I’m modifying.
Right now, I’m stuck on the following error when running the game:
No module named ‘direct.showbase.PhysicsManagerGlobal’
I compiled the Panda3D wheel with the libtoontown and installed it in the virtual environment.
I also added the wheel path to the requirements.txt
so that setuptools would use the compiled version, and that part seems fine.
However, the compiler apparently isn’t importing the direct
module (it works with cx_Freeze).
from setuptools import setup, find_packages
import os
import sys
setup(
name=“OpenToontownBR”,
find_packages=find_packages(where=“direct”),
package_dir={“”: “direct”},
options={
“build_apps”: {
“include_patterns”: [
# Arquivos Python e configurações
“/.py",
"etc/.prc",
"/.mf",
"**/.txt”,
# Recursos
“resources/",
"models/”,
“maps/",
"audio/”,
“config/",
"data/”,
],
“exclude_patterns”: [
“/*.pyc",
"/pycache/",
".git/”,
“build/**”,
],
“gui_apps”: {
“OpenToontownBR”: “main.py”,
},
“plugins”: [
“pandagl”,
“p3openal_audio”,
“p3ffmpeg”,
“p3ptloader”,
],
“platforms”: [
“linux_x86_64”,
# Descomente conforme necessário:
# “win_amd64”,
# “macosx_10_9_x86_64”,
],
“include_modules”: {
“*”: [
“direct”
“otp”,
“toontown”,
]
},
“log_filename”: “toontown.log”,
“log_append”: False,
}
},
)
And here is the cx_freeze setup
import sys
from cx_Freeze import setup, Executable
include_files = [
(‘resources’, ‘resources’),
(‘etc’, ‘etc’),
]
build_exe_options = {
‘packages’: [‘panda3d’, ‘direct’, ‘otp’, ‘toontown’],
‘include_files’: include_files,
‘excludes’: ,
}
base = None
if sys.platform == ‘win32’:
base = ‘Win32GUI’
executables = [
Executable(‘main.py’, base=base, target_name=‘OpenToontownBR’)
]
setup(
name=‘OpenToontownBR’,
version=‘1.0’,
description=‘Open Toontown BR’,
options={‘build_exe’: build_exe_options},
executables=executables
)
also my requirements.txt
pytz
panda3d
-f /home/ubuntu/Documentos/panda3d/panda3d-1.11.0-cp312-cp312-linux_x86_64.whl