New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyglet window does not open and crashes on start-up #1019
Comments
Can you try with a different Python version such as 3.10 or 3.11? This may be a 3.12 issue (see #961). |
Your pyglet.info is incomplete and doesn't show the OpenGL or graphics driver, which means it's probably crashing there as well. I would check your graphics drivers and make sure they are up to date. Also I've seen numerous tickets with issues with Anaconda environments, I would make sure to try your scripts outside that environment to ensure it's not that. Also I would try Python 3.11 to make sure it's not an issue there. It could also be a combination of all of these. Let us know. |
I have tried in a freshly created conda environment with Python 3.10. Unfortunately, can confirm the issue appeared in this environment as well (tested both in my app and in the very simple script mentioned at the end of the previous comment). Please find the output of
At this time I am not in a situation which allows me to easily test the app outside of a conda environment. Are there any actions we can take towards understanding if that may indeed be the cause of the issue? Perhaps if I packaged the interpreter with Pyinstaller, would that be worth trying? Or perhaps some debug options? Please also find the exact conda environment I am operating in, for future reference:
To my knowledge, all my drivers are up-to-date. Both Windows Update and Geforce Experience say no updates are available. |
I have made another observation in my attempts debugging, which I hope will be useful to further understand how to dig deeper. I have read about the I have vaguely understood what its purpose is, but not how to use it (and found no examples online, which I would therefore suggest to add to the documentation). I have however grasped that it's only useful if I had multiple windows (a.k.a. OpenGL contexts) in my app (which I don't), and that some drivers don't appreciate it. I have therefore tried to disable it using the global runtime options: In both of my test apps, the following behaviours were observed:
Other mysterious issue: Please let me know if these new findings are useful and how you would like to advance in debugging this issue. |
Unfortunately I still have yet to reproduce this. I have cleaned up the traces to give information on which functions are being called in the latest versions, but for now I will mark this as unreproducible. |
High-level description of the bug:
Good morning,
I have developed an application with Pyglet. When I run it from the console as such:
python ./app.py
, most of the time it works, the window opens and responds as expected. However, 1 out of 10 times approximately, after running that command, no window opens, nothing is printed on the console, but the process ends after a couple of seconds, leaving me with this:More details and the debugging I managed to do on my own follow in the "How To Reproduce" section.
I would be happy to support by providing further insights and debugging further under your guidance.
Thank you very much for your help.
System Information:
Here is the output of
python -m pyglet.info
:How To Reproduce:
Structure of the application
Content of app.py
Content of window.py
What I could debug:
I have made extensive use of
print
to trace the line where the program hangs.The culprit is line
super().__init__(**{.....})
inside ofwindow.py
. Indeed, theprint
function correctly printed before (inside the constructor of myWindow
class) but not after this line.Finally, I have attempted to use Pyglet's runtime options to try understanding what could be happening, but I could not interpret what they provided me. I have added the following lines on top of my
app.py
:Attached are two text files, one with the output for when the window runs as expected, and one for when it does not run as expected.
Run Fail.txt
Run Success.txt
Addendum:
Please note I was able to reproduce the error with a much simpler script:
The text was updated successfully, but these errors were encountered: