Egg2bam failed error with setuptools

I’m working on my first project, and as I make progress I’m trying to figure out how I’ll package it with setuptools. I’m attempting to troubleshoot this egg-related error when running my setup.py:

Error in venv/Lib/site-packages/setuptools-40.8.0-py3.7.egg at line 2,
column 2:
if [ basename $0 = “setuptools-40.8.0-py3.7.egg” ]
^
syntax error

egg2bam failed: Command ‘[‘egg2bam’, ‘-o’, ‘C:\Users\Me\PycharmProjects\project\build\win_amd64\venv\Lib\site-packages\setuptools-40.8.0-py3.7.egg.bam’, ‘-pd’, ‘C:\Users\Me\PycharmProjects\project\venv\Lib\site-packages’, ‘-ps’, ‘rel’, ‘venv\L
ib\site-packages\setuptools-40.8.0-py3.7.egg’]’ returned non-zero exit status 1.

My setup.py:

> from setuptools import setup
>
> setup(
>     name = "game",
>     options = {
>         "build_apps" : {
>             "include_patterns" : [
>                 "**/*.png",
>                 "**/*.ogg",
>                 "**/*.txt",
>                 "**/*.egg",
>                 "**/*.bam",
>                 "Fonts/*"
>             ],
>             "gui_apps" : {
>                 "MatW" : "testRoom.py"
>             },
>             'package_data_dirs': {
>                 'simplepbr': [
>                         ('simplepbr/shaders*', '', {}),
>                      ],
>             },
>             "plugins" : [
>                 "pandagl",
>                 "p3openal_audio"
>             ],
>             "platforms" : [
>                 "win_amd64"
>             ],
>             "log_filename" : "$USER_APPDATA/MatW/output.log",
>             "log_append" : False
>         }
>     }
> )

Out of curiosity I ran setup.py from the Asteroids sample and that resulting application works fine, so it has something to do with my project. With my game, the application is created but does not open. Not sure where to turn next so any pointers are appreciated!

I can assume that you don’t need the egg files in the final project. So try removing the egg pattern.
although on the contrary bam

Hm, getting rid of the .egg pattern did clear that error, but did not resolve the problem with my application. Looks like the egg wasn’t the actual issue. My error:

Building runtime for platform: win_amd64
There are some missing modules: ['__builtin__', '_posixsubprocess']
warning: build_apps: could not find dependency VERSION.dll (referenced by python37.dll)

warning: build_apps: could not find dependency SETUPAPI.dll (referenced by libpanda.dll)

warning: build_apps: could not find dependency bcrypt.dll (referenced by libcrypto-1_1.dll)

I now suspect that the issue is actually with my use of simplepbr as a render pipeline. Maybe I’m doing something wrong there. When testing on an empty panda window, I can successfully make an application without simplepbr, but including simplepbr will yield an application that will not open.

Don’t think the errors I posted above are actually relevant because I still get them with successful attempts at the empty window app and the asteroid app.

Now, taking simplepbr out of my actual project hasn’t fixed it, but at least it’s a start.

The error is due to the fact that your include patterns are picking up the venv subdirectory, which includes .egg files that are not in fact Panda3D .egg files. You should exclude it or use more specific include patterns.

You should share what’s written to the log file. It will tell us why it wouldn’t open.

Thanks, from the log:

Traceback (most recent call last):
  File "__main__", line 37, in <module>
  File "__main__", line 31, in __init__
  File "simplepbr", line 281, in init
  File "simplepbr", line 105, in __init__
  File "simplepbr", line 154, in _recompile_pbr
  File "simplepbr", line 45, in _load_shader_str
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Me\\PycharmProjects\\project\\build\\win_amd64\\shaders\\simplepbr.vert'

So it looks like I’m not moving the simplebpr shaders. How do I properly include that in setup.py? I understand the line to be ‘package_data_dirs’: {‘simplepbr’: [(‘simplepbr/shaders*’, ‘’, {}),],}, and have tried that under ‘options’ and ‘build_apps’ so far.

I think you should write simplepbr/shaders/*, note the intervening / at the end.

Still can’t get it to automatically move the shaders, but that made me realize that I can just manually move them over from the simplebr directory. That worked, thank you!