{"id":24203,"library":"passagemath-categories","title":"passagemath-categories","description":"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.","status":"active","version":"10.8.4","language":"python","source_language":"en","source_url":"https://github.com/passagemath/passagemath","tags":["passagemath","sage","categories","rings"],"install":[{"cmd":"pip install passagemath-categories","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Core configuration needed for any passagemath package","package":"passagemath-conf","optional":false}],"imports":[{"note":"passagemath packages keep the sage namespace; direct passagemath import path does not exist.","wrong":"from passagemath.categories import Category","symbol":"Category","correct":"from sage.categories.category import Category"},{"note":"Common typo using old or similar library names.","wrong":"from passerelle.categories import Rings","symbol":"Rings","correct":"from sage.categories.rings import Rings"}],"quickstart":{"code":"from sage.all import *\nfrom sage.categories.rings import Rings\nprint(Rings())\nprint(Category.super_categories_for_sets())","lang":"python","description":"Basic usage: import from sage namespace and use categories. Requires passagemath-conf and a passagemath environment."},"warnings":[{"fix":"Ensure 'passagemath-categories' is installed and import explicitely from sage.categories.","message":"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.","severity":"breaking","affected_versions":"10.8+"},{"fix":"Use the replacement as documented in SageMath release notes.","message":"Some old categories like 'SetsWithPartialMaps' are deprecated or removed. Check the SageMath migration guide.","severity":"deprecated","affected_versions":">=10.0"},{"fix":"Use 'from sage.categories import ...' instead of any passagemath prefixed import.","message":"Import paths differ from upstream SageMath. For example, 'sage.categories.all' works but not 'passagemath.categories.all'. Always use 'sage.categories.*'.","severity":"gotcha","affected_versions":"all"},{"fix":"Use a compatible Python interpreter (3.11-3.14).","message":"Python version constraint: requires python >=3.11,<3.15. Not compatible with Python 3.15+ or 3.10 and below.","severity":"gotcha","affected_versions":"10.8.x"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install passagemath-categories and use 'from sage.categories import ...'.","cause":"Assuming the package exposes a top-level 'passagemath' module. Actually it uses the 'sage' namespace.","error":"ModuleNotFoundError: No module named 'passagemath'"},{"fix":"Use 'from sage.categories.category import Category'.","cause":"Trying to import Category directly from sage.categories instead of sage.categories.category.","error":"ImportError: cannot import name 'Category' from 'sage.categories'"},{"fix":"Use 'from sage.categories.rings import Rings; Rings()'.","cause":"Calling Rings() before importing the class; or using Rings as a module.","error":"TypeError: 'module' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}