-
Notifications
You must be signed in to change notification settings - Fork 146
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
Using pyglet breaks on newer Python versions #361
Comments
Thanks for the report and posible workarounds Audio, import: yes, a change in python 3.12 imports resolution broke cocos. I missed the time to track the relevant import chain for a proper fix. You inject the dummy at the top of a user script, coco's Python 3.13: pyglet 1.5.8 is ancient, not sure if something else would break for (last cocos, pyglet 1.5.8, py3.13) If a pure pyglet script, like noisy.py or another of pyglet demo examples shows this issue it would be better to report to pyglet, and wait for their fix. If you want to look at that it would be great, if not I will try that route in a few days, I'm not on a 3.13-able machine ATM One more time, thanks |
At my own script, I wanted to remain
I was thinking that it would be weird to report the current issue to Here's the full traceback when I import cocos on Python 3.13 (with
|
Disclaimer
This is mainly suited for Windows. I am not sure if the same issue happens on Mac or other OSes.
Python 3.12
Since Python 3.12, there is a bug when using the latest version of
cocos
, specifically this line. It could be due to the new importing behaviors thatmusic
is not defined even after importingcocos.audio
.Current solution is to set a dummy attribute
mock_level
on Pyglet like this.How to reproduce the issue:
Python 3.13
The metaclass inheritance breaks on this version of Python, mainly caused by this line.
Based on pyglet/pyglet#288, the solution is to currently degrade
pyglet
to the version before the PR in question was made, which isv1.5.8
.How to reproduce the issue:
The text was updated successfully, but these errors were encountered: