PyVerse2D
raw JSON → 0.74.13 verified Sat May 09 auth: no python
PyVerse2D is a 2D game engine built on pyglet and OpenGL, designed for rapid prototyping of simple 2D games. Current version 0.74.13 supports Python >=3.10. The project is in active development with frequent releases.
pip install pyverse2d Common errors
error ModuleNotFoundError: No module named 'pyverse2d' ↓
cause Package not installed or installed in a different environment.
fix
Run 'pip install pyverse2d' in the same environment as your script.
error AttributeError: 'Verse' object has no attribute 'run' ↓
cause Using a very old version (<0.70) where the method was named 'start'.
fix
Upgrade to latest version: 'pip install --upgrade pyverse2d'
error ImportError: cannot import name 'Sprite' from 'pyverse2d' ↓
cause Trying to import Sprite directly from the main package instead of the graphics submodule.
fix
Use 'from pyverse2d.graphics import Sprite'
Warnings
breaking In version 0.74.x, the 'Verse' class constructor no longer accepts a 'width' and 'height' keyword argument; use the 'width' and 'height' attributes before calling 'run()'. ↓
fix Set app.width and app.height after instantiation, not in constructor.
deprecated The 'pyverse2d.constants' module is deprecated; use 'pyverse2d.math' for vector constants. ↓
fix Replace 'from pyverse2d.constants import *' with 'from pyverse2d.math import VEC2_ZERO' etc.
gotcha Pyglet 2.0 is not supported; force pyglet 1.5.x in your requirements. ↓
fix Add 'pyglet>=1.5,<2.0' to your project dependencies.
Imports
- Verse wrong
from pyverse2d.verse import Versecorrectfrom pyverse2d import Verse - Sprite wrong
from pyverse2d.sprite import Spritecorrectfrom pyverse2d.graphics import Sprite
Quickstart
from pyverse2d import Verse
app = Verse()
app.title = 'My Game'
app.run()