Install & Compatibility
Where this runs
tested against v1.2.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.910 runs
installs and imports cleanly · install 0.0s · import 0.274s · 89.5MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.6s · import 0.280s · 86MB
89MB installed
● package 89MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Cube
✓ from magiccube import Cube
✗ from magiccube.cube import Cube
As of v1.2.0, key public objects like `Cube` are directly exposed in the top-level `magiccube` namespace. Direct import is preferred.
Move
✓ from magiccube.cube import Move
While `Cube` is top-level, other related classes like `Move` remain in their submodules.
KociembaSolver
✓ from magiccube.solver import KociembaSolver
`KociembaSolver` and other solver-related classes are found within the `magiccube.solver` submodule.
This quickstart demonstrates how to instantiate a cube, scramble it, retrieve its state in Kociemba format, solve it using the Kociemba solver, and apply the solution.
from magiccube import Cube
from magiccube.cube import Move
from magiccube.solver import KociembaSolver
# Create a 3x3x3 cube
c = Cube(3)
# Scramble the cube
c.scramble(count=25)
print('Scrambled cube:')
print(c)
# Get facelet colors in Kociemba format
kociemba_colors = c.get_kociemba_facelet_colors()
print(f'Kociemba facelet colors: {kociemba_colors}')
# Solve the cube using Kociemba's algorithm
solver = KociembaSolver(c)
solution = solver.solve()
print(f'Solution: {solution}')
# Apply the solution to verify
c.rotate(solution)
print('Solved cube:')
print(c)
assert c.is_solved()
Errors
Common errors & fixes
AttributeError: module 'magiccube.cube' has no attribute 'Cube'
Attempting to import `Cube` from `magiccube.cube` after the v1.2.0 change which moved `Cube` to the top-level `magiccube` namespace, and some environments might not correctly resolve the old path.
fixChange the import statement to `from magiccube import Cube`.
ValueError: Invalid move 'R3'. Move count must be 1 or 2 for SiGN notation. (Got 3)
Using a move string with a count greater than 2 (e.g., 'R3') after the v1.2.0 update to SiGN notation.
fixRewrite the move using SiGN notation (e.g., 'R''' or 'R' instead of 'R3'). For a 'U3' equivalent, use 'U'' or 'U PRIME'.
RuntimeError: This library requires Python 3.9 or newer. You are running 3.X.Y
Running `magiccube` v1.1.0 or newer with a Python interpreter older than 3.9.
fixUpgrade your Python environment to version 3.9 or later. You can use `pyenv` or `conda` to manage multiple Python versions.
Upgrade
Version history
1.2.0latest on PyPI · released Apr 27, 2025
Audit
Dependencies
No dependency data recorded yet.