Install & Compatibility
Where this runs
tested against v4.12.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 4.308s · 41.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.1s · import 3.984s · 42MB
39MB installed
● package 39MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Stage
✓ from apysc import Stage
✗ from apysc.display import Stage
Stage is at top-level, not under display.
Sprite
✓ from apysc import Sprite
✗ from apysc.display import Sprite
Sprite has been moved to top-level; old import may fail.
Rectangle
✓ from apysc import Rectangle
✗ from apysc.geom import Rectangle
Geometric shapes are now in top-level.
Creates a basic stage with a blue rectangle and saves as HTML.
from apysc import Stage, Sprite, Rectangle
stage = Stage(
stage_width=200,
stage_height=200,
background_color='#333',
stage_elem_id='stage'
)
sprite = Sprite(stage=stage)
sprite.graphics.begin_fill(color='#0af')
rect = sprite.graphics.draw_rect(x=50, y=50, width=100, height=100)
stage.save_as_html(file_path='output.html')
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'apysc'
apysc is not installed.
fixRun: pip install apysc
ImportError: cannot import name 'Sprite' from 'apysc'
Old import path used (e.g., from apysc.display import Sprite) which no longer exists in v4.
fixUse: from apysc import Sprite
TypeError: __init__() got multiple values for argument 'stage_width'
Passing positional arguments to Stage constructor instead of keyword arguments.
fixUse keyword arguments: Stage(stage_width=..., stage_height=..., ...)
Upgrade
Version history
4.12.0latest on PyPI · released Aug 11, 2024
Audit
Dependencies
No dependency data recorded yet.