Could not pack application using setuptools

Previously was using the p3d method to distribute my application. Since it is deprecated in 1.10, I am trying to pack my project with the new setuptools package and I am having some troubles packing the app…

from setuptools import setup

setup(
    name='application',
    options={
        'build_apps': {
            'gui_apps': {'main': 'main.py'},
            'platforms': [
                'win_amd64',],
        }
    }
)

and running on cmd:

python setup.py build_apps

error:

Successfully downloaded boto3 botocore certifi chardet docutils idna jmespath panda3d Pillow python-dateutil pytz requests s3transfer six urllib3 virtualenv zope.interface setuptools
Could not find an optimized wheel (using index Simple Index) for platform: win_amd64
Building runtime for platform: win_amd64
There are some missing modules: [‘Cookie’, ‘ElementC14N’, ‘OpenSSL.SSL’, ‘StringIO’, ‘TiffImagePlugin’, ‘Tools.PIL.BmpImagePlugin’, ', ‘builtin’, ‘_abcoll’, ‘_posixsubprocess’, ‘_scproxy’, ‘_uuid’, ‘_version’, ‘_xmlplus’, ‘algebra.CubicBezierCurve’, ‘algebra.CubicSpline’, ‘algebra.Ray2D’, ‘algebra.equals_almost’, ‘algebra.rotate_2d’, ‘ascii’, ‘backports.ssl_match_hostname’, ‘binary’, ‘brotli’, ‘cffi’, ‘cookielib’,‘ndg.httpsclient.ssl_peer_verification’, ‘ndg.httpsclient.subj_alt_name’, ‘netbios’, ‘numpy’, ‘ordereddict’, ‘packages.six.moves’, ‘packages.six.moves.http_client’, ‘packages.six.moves.urllib.parse’, ‘packages.ssl_match_hostname.CertificateError’, ‘packages.ssl_match_hostname.match_hostname’, ‘packages.urllib3.util.Timeout’, ‘pathlib2’, ‘pyasn1.codec.der’, ‘pyasn1.type’, ‘simplejson’, ‘socks’, ‘thread’, ‘tz.tzlocal’, ‘tz.tzutc’, ‘urllib.getproxies’, ‘urllib.proxy_bypass’, ‘urllib.quote’, ‘urllib.quote_plus’, ‘urllib.unquote’, ‘urllib.unquote_plus’, ‘urllib.urlencode’, ‘urllib2’, ‘urlparse’, ‘win32wnet’]
warning: build_apps: could not find dependency VERSION.dll (referenced by python37.dll)
warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by python37.dll)
warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by deploy-stubw.exe)
warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by libcrypto-1_1-x64.dll)
warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by _hashlib.pyd)
warning: build_apps: could not find dependency SETUPAPI.dll (referenced by libpanda.dll)
warning: build_apps: could not find dependency CRYPT32.dll (referenced by _ssl.pyd)
Copying game files for platform: win_amd64

an Exe file is still created after all the errors, but nothing runs and no error message is shown when I tried to open it… I put print messages in each files trying to know where it goes wrong but not even one print message pass through…

I also tried using ‘console_apps’ as option instead of ‘gui_apps’ and this shows:

:display(warning): Unable to load: Path not found
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
  File "main.py", line 24, in <module>
    base = ShowBase()
  File "C:\Users\Riley\xxxxxxx\build\__whl_cache__\panda3d-1.10.3-cp37-cp37m-win_amd64.whl\direct\showbase\ShowBase.py", line 274, in __init__
  File "C:\Users\Riley\xxxxxxx\build\__whl_cache__\panda3d-1.10.3-cp37-cp37m-win_amd64.whl\direct\showbase\ShowBase.py", line 942, in openDefaultWindow
  File "C:\Users\Riley\xxxxxxx\build\__whl_cache__\panda3d-1.10.3-cp37-cp37m-win_amd64.whl\direct\showbase\ShowBase.py", line 978, in openMainWindow
  File "C:\Users\Riley\xxxxxxx\build\__whl_cache__\panda3d-1.10.3-cp37-cp37m-win_amd64.whl\direct\showbase\ShowBase.py", line 690, in openWindow
  File "C:\Users\Riley\xxxxxxx\build\__whl_cache__\panda3d-1.10.3-cp37-cp37m-win_amd64.whl\direct\showbase\ShowBase.py", line 676, in <lambda>
  File "C:\Users\Riley\xxxxxxx\build\__whl_cache__\panda3d-1.10.3-cp37-cp37m-win_amd64.whl\direct\showbase\ShowBase.py", line 742, in _doOpenWindow
  File "C:\Users\Riley\xxxxxxx\build\__whl_cache__\panda3d-1.10.3-cp37-cp37m-win_amd64.whl\direct\showbase\ShowBase.py", line 581, in makeDefaultPipe
  File "C:\Users\Riley\xxxxxxx\build\__whl_cache__\panda3d-1.10.3-cp37-cp37m-win_amd64.whl\direct\directnotify\Notifier.py", line 130, in error
Exception: No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.

You need to add a render plug-in, such as plugins: ['libpandagl'].

Also, note that GUI apps have no command-line output, so without setting up logging, there is no way to get the output. It is easiest to write this to a log file, for example:

            'log_filename': '$USER_APPDATA/Your Game/output.log',
            'log_append': False,

You can see a functional example of a setup.py file here: