I’m ready to distribute my Panda3D app for testing by some colleagues. I successfully used the the sample asteroids setup.py bdist_apps. The build warned of a few missing modules that I don’t actually use. However, the standalone asteroids app that I built successfully ran on Ubuntu and Windows 10 systems w/o python installed.
I optimistically customized the setup.py and requirements.txt to similarly package my app. I started with my running Panda 1.10.7 on Python 3.9, but found that bdist_apps was using a method that is deprecated in 3.9. So, I built a fresh venv with python 3.8.5, the newest panda3d-1.10.8, and my python code. I got bdist_apps to build with only minor warnings of missing modules. However, nothing seemed to happen when I executed the built executable. Same behavior from the command line and OS GUI; on both Ubuntu and Windows 10.
This is my first experience with building a standalone app. So, I tried a very simple console_app to find the first problem and reduced it to the python below which exhibits an exception that I don’t understand. The following program executes successfully within a Python 3.8.5 environment, but fails in a standalone app built by bdist_apps.
#
print('Hello World')
from pytz import timezone
print('through the import')
home_zone = timezone('US/Eastern')
print('success')
print(f"home_zone={home_zone}, type={type(home_zone)}")
I created the following setup.py:
#
#
from setuptools import find_packages, setup
setup(
name='build_bug',
version='0.3',
author='Dennis Risen',
author_email='dar5@case.edu',
description='debugging the bdist process',
packages=find_packages(),
classifiers=[
'Programming Language :: Python :: 3',
'Operating System :: OS Independent'
],
python_requires='>=3.6',
options={
'build_apps': {
'console_apps': {
'build_bug': 'build_bug.py'
},
'platforms': [
'manylinux1_x86_64',
'win_amd64'
]
}
}
)
and requirements.txt:
pytz
When I run “python setup.py bdist_apps”, it successfully ‘downloaded’ the cached pytz-2021.1, and built standalone distributions while reporting only minor issues:
There are some missing modules: ['UserDict', '__builtin__', '_uuid', 'com.sun', 'com.sun.jna', 'com.sun.jna.platform', 'netbios', 'ordereddict', 'pkg_resources.extern.appdirs', 'pkg_resources.extern.packaging', 'sets', 'win32com.shell', 'win32wnet', 'zipimport']
There are some missing modules: ['_posixsubprocess', 'grp']
warning: build_apps: could not find dependency api-ms-win-crt-utility-l1-1-0.dll (referenced by libcrypto-1_1.dll)
Each standalone distribution executes on its respective system, producing the same output with exception from pytz.timezone:
Hello World
through the import
Traceback (most recent last call):
File "__main__", line 5, in <module>
File "pytz", line 188, in timezone
pytz.exceptions.UnknownTimeZoneError: 'US/Eastern'
If pytz is just an oddball that works fine with a normal build, but not with build_apps; I can workaround. However, my app imports a dozen other modules. I’d hate to slug through potential multiple issues due to me just not using a robust technology for building standalone apps. Any advice on robust building of standalone Panda3D apps?