{"id":24391,"library":"pyrr","title":"Pyrr","description":"Pyrr provides 3D mathematical functions (matrices, quaternions, vectors, eulers) using NumPy arrays. Current version: 0.10.3. Infrequent releases, last stable in 2022.","status":"active","version":"0.10.3","language":"python","source_language":"en","source_url":"https://github.com/adamlwgriffiths/Pyrr","tags":["3d-math","geometry","numpy","quaternions","matrices"],"install":[{"cmd":"pip install pyrr","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Core dependency for all array operations","package":"numpy","optional":false}],"imports":[{"note":"Correct import path","symbol":"Matrix44","correct":"from pyrr import Matrix44"},{"note":"","symbol":"Quaternion","correct":"from pyrr import Quaternion"},{"note":"","symbol":"Vector3","correct":"from pyrr import Vector3"},{"note":"Submodule functions must be imported explicitly; top-level only has classes.","wrong":"from pyrr import matrix44","symbol":"matrix44","correct":"from pyrr.matrix44 import create_from_translation"},{"note":"","symbol":"euler","correct":"from pyrr import euler"}],"quickstart":{"code":"import numpy as np\nfrom pyrr import Matrix44, Vector3, Quaternion\n\n# Create a translation matrix\ntrans = Matrix44.from_translation([1, 2, 3])\nprint(trans)\n\n# Create a rotation quaternion (90 degrees around Y axis)\nrot = Quaternion.from_axis_rotation([0.0, 1.0, 0.0], np.pi/2)\nprint(rot)\n\n# Apply rotation to a vector\nvec = Vector3([1, 0, 0])\ntransformed = rot * vec\nprint(transformed)","lang":"python","description":"Creates a translation matrix, a rotation quaternion, and applies it to a vector."},"warnings":[{"fix":"Update calls: `euler.create_from_euler(roll, pitch, yaw, ...)` instead of `(pitch, roll, yaw, ...)`.","message":"In 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.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Use the new function names without '_matrix'. Check the deprecation warnings in your code.","message":"In 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`.","severity":"breaking","affected_versions":">=0.9.0"},{"fix":"Avoid modifying `obj.flat` or `.data`; use obj.copy() or constructors.","message":"Pyrr internally uses NumPy arrays. Directly mutating the underlying array can cause unexpected behavior. Always use the provided methods or create new objects.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install --upgrade pyrr`. Then use `from pyrr.matrix44 import create_from_translation`.","cause":"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.","error":"ImportError: cannot import name 'matrix44' from 'pyrr'"},{"fix":"Use `if vec.any():` or `if vec.all():` depending on intent.","cause":"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.","error":"ValueError: The truth value of an array with more than one element is ambiguous."},{"fix":"Use `from pyrr.matrix44 import create_look_at` and call `create_look_at(eye, target, up)`.","cause":"Using old API. `create_look_at` is a module-level function, not a method on Matrix44. Also, it was renamed in 0.9.0.","error":"AttributeError: 'Matrix44' object has no attribute 'create_look_at'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}