Install & Compatibility
Where this runs
tested against v0.10.3 · 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 0.310s · 89.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.290s · 86MB
89MB installed
● package 89MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Matrix44
✓ from pyrr import Matrix44
Correct import path
Quaternion
✓ from pyrr import Quaternion
Vector3
✓ from pyrr import Vector3
matrix44
✓ from pyrr.matrix44 import create_from_translation
✗ from pyrr import matrix44
Submodule functions must be imported explicitly; top-level only has classes.
euler
✓ from pyrr import euler
Creates a translation matrix, a rotation quaternion, and applies it to a vector.
import numpy as np
from pyrr import Matrix44, Vector3, Quaternion
# Create a translation matrix
trans = Matrix44.from_translation([1, 2, 3])
print(trans)
# Create a rotation quaternion (90 degrees around Y axis)
rot = Quaternion.from_axis_rotation([0.0, 1.0, 0.0], np.pi/2)
print(rot)
# Apply rotation to a vector
vec = Vector3([1, 0, 0])
transformed = rot * vec
print(transformed)
Errors
Common errors & fixes
ImportError: cannot import name 'matrix44' from 'pyrr'
After 0.9.0, some submodules like 'pyrr.matrix44' are still present but functions have been renamed. However, the import itself should work if the module exists. This error may occur if the package is not installed correctly or if there's a naming confusion.
fixRun `pip install --upgrade pyrr`. Then use `from pyrr.matrix44 import create_from_translation`.
ValueError: The truth value of an array with more than one element is ambiguous.
Using a Pyrr object (e.g., Vector3) in a boolean context (if vec: ...). Pyrr objects inherit NumPy array behavior and cannot be used as booleans directly.
fixUse `if vec.any():` or `if vec.all():` depending on intent.
AttributeError: 'Matrix44' object has no attribute 'create_look_at'
Using old API. `create_look_at` is a module-level function, not a method on Matrix44. Also, it was renamed in 0.9.0.
fixUse `from pyrr.matrix44 import create_look_at` and call `create_look_at(eye, target, up)`.
Upgrade
Version history
0.10.3latest on PyPI · released Apr 18, 2019
Audit
Dependencies
numpyrequiredCore dependency for all array operations