passagemath-categories
raw JSON → 10.8.4 verified Fri May 01 auth: no python
Part of the passagemath ecosystem, providing SageMath's category framework and basic rings. Current version 10.8.4, Python 3.11-3.14. Released every few months alongside passagemath releases.
pip install passagemath-categories Common errors
error ModuleNotFoundError: No module named 'passagemath' ↓
cause Assuming the package exposes a top-level 'passagemath' module. Actually it uses the 'sage' namespace.
fix
Install passagemath-categories and use 'from sage.categories import ...'.
error ImportError: cannot import name 'Category' from 'sage.categories' ↓
cause Trying to import Category directly from sage.categories instead of sage.categories.category.
fix
Use 'from sage.categories.category import Category'.
error TypeError: 'module' object is not callable ↓
cause Calling Rings() before importing the class; or using Rings as a module.
fix
Use 'from sage.categories.rings import Rings; Rings()'.
Warnings
breaking passagemath-categories 10.8 splits off category framework from monolithic sage. Old 'from sage.all import *' still works but may break if you previously relied on sage.categories being loaded by default. ↓
fix Ensure 'passagemath-categories' is installed and import explicitely from sage.categories.
deprecated Some old categories like 'SetsWithPartialMaps' are deprecated or removed. Check the SageMath migration guide. ↓
fix Use the replacement as documented in SageMath release notes.
gotcha Import paths differ from upstream SageMath. For example, 'sage.categories.all' works but not 'passagemath.categories.all'. Always use 'sage.categories.*'. ↓
fix Use 'from sage.categories import ...' instead of any passagemath prefixed import.
gotcha Python version constraint: requires python >=3.11,<3.15. Not compatible with Python 3.15+ or 3.10 and below. ↓
fix Use a compatible Python interpreter (3.11-3.14).
Imports
- Category wrong
from passagemath.categories import Categorycorrectfrom sage.categories.category import Category - Rings wrong
from passerelle.categories import Ringscorrectfrom sage.categories.rings import Rings
Quickstart
from sage.all import *
from sage.categories.rings import Rings
print(Rings())
print(Category.super_categories_for_sets())