Hi all,
I’m experimenting with building and distributing and so far, I have a strange problem. I hope those experienced with this can offer help. To start, I wrote a very simple application that changes the colour of a button whenever it is pressed, here is the code:
from direct.showbase.ShowBase import ShowBase
from direct.gui.DirectGui import *
import random
class run_me(ShowBase):
def __init__(self):
ShowBase.__init__(self)
#Actor tests here:
#self.pandaActos = Actor()
base.setBackgroundColor(0.5,0.8,0.7,1)
currentId=0
#put a button at the centre:
self.newPackage=DirectButton(text = ("New Package", "New Package", "New Package", "New Package"),pos=(-0.0312056, 0, 0.156028),scale=.05)
self.newPackage["command"]=self.changeColor
def changeColor(self):
coloList=[]
for i in range(4):
colG=random.uniform(0,1)
coloList.append(colG)
self.newPackage["frameColor"]=(coloList[0],coloList[1],coloList[2],coloList[3])
w = run_me()
w.run()
And here is what my setup.py looks like:
from setuptools import setup
setup(
name='colouring',
options={
'build_apps': {
# Build asteroids.exe as a GUI application
'gui_apps': {
'colouring': 'testdist.py',
},
# Set up output logging, important for GUI apps!
'log_filename': '$USER_APPDATA/colouring/output.log',
'log_append': False,
# Include the OpenGL renderer and OpenAL audio plug-in
'plugins': [
'pandagl',
'p3openal_audio',
],
#target os-types to build for
'platforms': ['manylinux2010_x86_64', 'macosx_10_9_x86_64', 'win_amd64'],
}
}
)
And here is what I added to the requirements.txt file:
panda3d~=1.10.14
When building, I ran into a few errors, upon trying to run the executable, the output.log file yields this error:
Traceback (most recent call last):
File "__main__", line 1, in <module>
File "importlib._bootstrap", line 983, in _find_and_load
File "importlib._bootstrap", line 967, in _find_and_load_unlocked
File "importlib._bootstrap", line 677, in _load_unlocked
File "importlib._bootstrap", line 819, in exec_module
File "direct.showbase.ShowBase", line 58, in <module>
File "importlib._bootstrap", line 983, in _find_and_load
File "importlib._bootstrap", line 967, in _find_and_load_unlocked
File "importlib._bootstrap", line 677, in _load_unlocked
File "importlib._bootstrap", line 819, in exec_module
File "direct.directnotify.DirectNotifyGlobal", line 5, in <module>
File "importlib._bootstrap", line 1035, in _handle_fromlist
File "importlib._bootstrap", line 219, in _call_with_frames_removed
File "importlib._bootstrap", line 983, in _find_and_load
File "importlib._bootstrap", line 967, in _find_and_load_unlocked
File "importlib._bootstrap", line 677, in _load_unlocked
File "importlib._bootstrap", line 819, in exec_module
File "direct.directnotify.DirectNotify", line 5, in <module>
File "importlib._bootstrap", line 1035, in _handle_fromlist
File "importlib._bootstrap", line 219, in _call_with_frames_removed
File "importlib._bootstrap", line 983, in _find_and_load
File "importlib._bootstrap", line 967, in _find_and_load_unlocked
File "importlib._bootstrap", line 677, in _load_unlocked
File "importlib._bootstrap", line 819, in exec_module
File "direct.directnotify.Notifier", line 6, in <module>
File "importlib._bootstrap", line 1035, in _handle_fromlist
File "importlib._bootstrap", line 219, in _call_with_frames_removed
File "importlib._bootstrap", line 983, in _find_and_load
File "importlib._bootstrap", line 967, in _find_and_load_unlocked
File "importlib._bootstrap", line 677, in _load_unlocked
File "importlib._bootstrap", line 819, in exec_module
File "direct.showbase.PythonUtil", line 47, in <module>
File "importlib._bootstrap", line 983, in _find_and_load
File "importlib._bootstrap", line 967, in _find_and_load_unlocked
File "importlib._bootstrap", line 677, in _load_unlocked
File "importlib._bootstrap", line 819, in exec_module
File "functools", line 21, in <module>
File "importlib._bootstrap", line 983, in _find_and_load
File "importlib._bootstrap", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'collections'
When actually running the ppython setup.py bdist_apps
command, this is the output:
running bdist_apps
running build_apps
Building platforms: manylinux2010_x86_64,macosx_10_9_x86_64,win_amd64
Gathering wheels for platform: manylinux2010_x86_64
Looking in indexes: https://pypi.org/simple, https://archive.panda3d.org/simple/opt, https://archive.panda3d.org/thirdparty
Collecting panda3d~=1.10.14
Downloading https://buildbot.panda3d.org/downloads/8e539bd99840da261853c08bc426e0ea43bddd24/opt/panda3d-1.10.14%2Bopt-cp37-cp37m-manylinux2010_x86_64.whl (52.0 MB)
|████████████████████████████████| 52.0 MB 20 kB/s
Saved c:\panda3d-1.10.14-x64\build\__whl_cache__\manylinux2010_x86_64_cp37m\panda3d-1.10.14+opt-cp37-cp37m-manylinux2010_x86_64.whl
Successfully downloaded panda3d
Building runtime for platform: manylinux2010_x86_64
There are some missing modules: ['collections', 'collections.abc', 'importlib.metadata']
Copying game files for platform: manylinux2010_x86_64
Gathering wheels for platform: macosx_10_9_x86_64
Looking in indexes: https://pypi.org/simple, https://archive.panda3d.org/simple/opt, https://archive.panda3d.org/thirdparty
Collecting panda3d~=1.10.14
Downloading https://buildbot.panda3d.org/downloads/8e539bd99840da261853c08bc426e0ea43bddd24/opt/panda3d-1.10.14%2Bopt-cp37-cp37m-macosx_10_9_x86_64.whl (62.7 MB)
|████████████████████████████████| 62.7 MB 58 kB/s
Saved c:\panda3d-1.10.14-x64\build\__whl_cache__\macosx_10_9_x86_64_cp37m\panda3d-1.10.14+opt-cp37-cp37m-macosx_10_9_x86_64.whl
Successfully downloaded panda3d
Building runtime for platform: macosx_10_9_x86_64
warning: build_apps: Missing audio plugin p3fmod_audio referenced in PRC data, replacing with p3openal_audio
Copying game files for platform: macosx_10_9_x86_64
Bundling macOS app into C:\Panda3D-1.10.14-x64\build\macosx_10_9_x86_64\colouring.app
Gathering wheels for platform: win_amd64
Looking in indexes: https://pypi.org/simple, https://archive.panda3d.org/simple/opt, https://archive.panda3d.org/thirdparty
Collecting panda3d~=1.10.14
Downloading https://buildbot.panda3d.org/downloads/8e539bd99840da261853c08bc426e0ea43bddd24/opt/panda3d-1.10.14%2Bopt-cp37-cp37m-win_amd64.whl (64.9 MB)
|████████████████████████████████| 64.9 MB 1.0 kB/s
Saved c:\panda3d-1.10.14-x64\build\__whl_cache__\win_amd64_cp37m\panda3d-1.10.14+opt-cp37-cp37m-win_amd64.whl
Successfully downloaded panda3d
Building runtime for platform: win_amd64
There are some missing modules: ['_posixsubprocess']
warning: build_apps: bz2.pyd was not found in any downloaded wheel, is a dependency missing from requirements.txt?
warning: build_apps: could not find dependency python27.dll (referenced by bz2.pyd)
warning: build_apps: could not find dependency MSVCR90.dll (referenced by bz2.pyd)
Copying game files for platform: win_amd64
Building gztar for platform: manylinux2010_x86_64
Building zip for platform: macosx_10_9_x86_64
Building zip for platform: win_amd64
As can be seen, there are some errors it raises, but what could be causing them for such a rudimentary application?
I greatly appreciate any help offered,
Thanks in advance.
EDITS:
I added the entire output.log file. Upon running the executable, absolutely nothing happens, but the output.log file is modified as pasted here. What could be causing this? I’m at an impasse…