Registry / data / pyrr
library0.10.3pypypi✓ verified 86d ago

Pyrr provides 3D mathematical functions (matrices, quaternions, vectors, eulers) using NumPy arrays. Current version: 0.10.3. Infrequent releases, last stable in 2022.

pip install pyrr
INSTALL
IMPORT
SIG · PYRR
P
pyrr
datapythonv0.10.3
Install
3.7s avg
Import
300ms
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.310s · 89.9MB
glibc
py 3.103.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)
Debug
Known issues
breakingIn version 0.8.0, the parameter order for `euler.create_from_euler` changed from (pitch, roll, yaw) to (roll, pitch, yaw). Code using the old order will produce incorrect rotations.
fix
Update calls: `euler.create_from_euler(roll, pitch, yaw, ...)` instead of `(pitch, roll, yaw, ...)`.
affects: >=0.8.0
breakingIn version 0.9.0, many matrix functions with '_matrix' in the name were deprecated. For example, `matrix44.create_look_at_matrix` is deprecated in favor of `matrix44.create_look_at`.
fix
Use the new function names without '_matrix'. Check the deprecation warnings in your code.
affects: >=0.9.0
gotchaPyrr internally uses NumPy arrays. Directly mutating the underlying array can cause unexpected behavior. Always use the provided methods or create new objects.
fix
Avoid modifying `obj.flat` or `.data`; use obj.copy() or constructors.
affects: all
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.
fix
Run `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.
fix
Use `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.
fix
Use `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
Agent activity
13 hits · last 30 days
node
12
Resources
pyrr — pip install pyrr · libregistry