Error messages in 10.9.beta9?

188 views
Skip to first unread message

Martin R

unread,
Apr 15, 2026, 9:22:36 AMApr 15
to sage-devel
I used to get

sage: s = SymmetricFunctions(QQ).s()
sage: f = s[2,1]
sage: f.to_vector()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/sage/src/sage/structure/category_object.pyx:842, in sage.structure.category_object.CategoryObject.getattr_from_category()
   841 try:
--> 842     return self.__cached_methods[name]
   843 except KeyError:

KeyError: '_dense_free_module'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
Cell In [3], line 1
----> 1 f.to_vector()

File ~/sage/src/sage/modules/with_basis/indexed_element.pyx:802, in sage.modules.with_basis.indexed_element.IndexedFreeModuleElement._vector_()
   800      optimizations.
   801 """
--> 802 free_module = self._parent._dense_free_module(new_base_ring)
   803 if sparse:
   804     free_module = free_module.sparse_module()

File ~/sage/src/sage/structure/category_object.pyx:836, in sage.structure.category_object.CategoryObject.__getattr__()
   834         AttributeError: 'PrimeNumbers_with_category' object has no attribute 'sadfasdf'
   835     """
--> 836     return self.getattr_from_category(name)
   837  
   838 cdef getattr_from_category(self, name):

File ~/sage/src/sage/structure/category_object.pyx:851, in sage.structure.category_object.CategoryObject.getattr_from_category()
   849     cls = self._category.parent_class
   850  
--> 851 attr = getattr_from_other_class(self, cls, name)
   852 self.__cached_methods[name] = attr
   853 return attr

File ~/sage/src/sage/cpython/getattr.pyx:357, in sage.cpython.getattr.getattr_from_other_class()
   355     dummy_error_message.cls = type(self)
   356     dummy_error_message.name = name
--> 357     raise AttributeError(dummy_error_message)
   358 cdef PyObject* attr = instance_getattr(cls, name)
   359 if attr is NULL:

AttributeError: 'SymmetricFunctionAlgebra_schur_with_category' object has no attribute '_dense_free_module'


Now I get

sage: s = SymmetricFunctions(QQ).s()
sage: f = s[2,1]
sage: f.to_vector()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File sage/structure/category_object.pyx:856, in sage.structure.category_object.CategoryObject.getattr_from_category()
--> 856 'Could not get source, probably due dynamically evaluated source code.'

KeyError: '_dense_free_module'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 f.to_vector()

File sage/modules/with_basis/indexed_element.pyx:855, in sage.modules.with_basis.indexed_element.IndexedFreeModuleElement._vector_()
--> 855 'Could not get source, probably due dynamically evaluated source code.'

File sage/structure/category_object.pyx:850, in sage.structure.category_object.CategoryObject.__getattr__()
--> 850 'Could not get source, probably due dynamically evaluated source code.'

File sage/structure/category_object.pyx:865, in sage.structure.category_object.CategoryObject.getattr_from_category()
--> 865 'Could not get source, probably due dynamically evaluated source code.'

File sage/cpython/getattr.pyx:357, in sage.cpython.getattr.getattr_from_other_class()
--> 357 'Could not get source, probably due dynamically evaluated source code.'

AttributeError: 'SymmetricFunctionAlgebra_schur_with_category' object has no attribute '_dense_free_module'


Dima Pasechnik

unread,
Apr 15, 2026, 2:27:54 PMApr 15
to sage-...@googlegroups.com
It's the same KeyError and AttributeError, what exactly is the problem you are facing here?

Nils Bruin

unread,
Apr 15, 2026, 8:20:55 PMApr 15
to sage-devel
There is no source lookup in the traceback anymore. I am seeing the same thing on 10.9.beta9,  but without the ungrammatical error messages. It looks like something has changed that has affected the availability of source code in cython files for tracebacks.

Antonio Rojas

unread,
Apr 16, 2026, 2:39:44 AMApr 16
to sage-devel
Are you running sage on the same machine where you compiled it, and are the source files still available in their original location?

Martin R

unread,
Apr 16, 2026, 6:01:44 AMApr 16
to sage-devel
yes (to both).  It's a configure/make install, not conda.

Dima Pasechnik

unread,
Apr 16, 2026, 12:43:46 PMApr 16
to sage-...@googlegroups.com
it probably comes from a recent ipython upgrade.

The code is still there, but ipython no longer knows where to look, I gather.

Dima Pasechnik

unread,
Apr 16, 2026, 12:43:52 PMApr 16
to sage-...@googlegroups.com
On April 16, 2026 1:39:44 AM CDT, Antonio Rojas <nqn...@gmail.com> wrote:

Martin R

unread,
Apr 17, 2026, 3:36:20 AMApr 17
to sage-devel
Downgrading IPython to 8.18.1 using

sage -sh
(sage-sh) martin@convex63:sage$ pip install ipython==8.18.1

does *not* solve the issue.  (or would I have to recompile sage to see a difference?)

Martin

Martin R

unread,
Apr 17, 2026, 5:30:51 AMApr 17
to sage-devel
an LLM says that the paths might be wrong.  Above, in the working version we have


KeyError                                  Traceback (most recent call last)
File ~/sage/src/sage/structure/category_object.pyx:842, in sage.structure.category_object.CategoryObject.getattr_from_category()


whereas in the new version we have


KeyError                                  Traceback (most recent call last)
File sage/structure/category_object.pyx:856, in sage.structure.category_object.CategoryObject.getattr_from_category()
--> 856 'Could not get source, probably due dynamically evaluated source code.'

This only happens for cython files:

try:
    s = SymmetricFunctions(QQ).s()
    s[1,2]
except:
    tb = sys.exc_info()[2]
    while tb:
        print(tb.tb_frame.f_code.co_filename)
        tb = tb.tb_next

gives

<string>
/home/martin/sage/src/sage/combinat/sf/sfa.py
sage/structure/parent.pyx
sage/structure/coerce_maps.pyx
sage/structure/coerce_maps.pyx
/home/martin/sage/src/sage/combinat/partition.py

Martin R

unread,
Apr 17, 2026, 5:48:14 AMApr 17
to sage-devel
It further analyzed that the problem might originate in `sage_setup/find.py`
```
def find_python_sources(src_dir, modules=['sage'], distributions=None,
                        exclude_distributions=None):
```

I have to stop here.

Martin

Antonio Rojas

unread,
Apr 17, 2026, 2:19:38 PMApr 17
to sage-devel
This is a problem with editable installs. Cython expects the source pyx files to be available alongside the compiled modules, and that is not the case in editable installs, where the source pyx files are in the source dir and the compiled modules are somewhere else.

Dima Pasechnik

unread,
Apr 17, 2026, 9:29:23 PMApr 17
to sage-...@googlegroups.com
Yes, I can confirm that the classic (sage-distro) build with
"./configure --disable-editable" fixes this

sage: sage: s = SymmetricFunctions(QQ).s()
....: sage: f = s[2,1]
....: sage: f.to_vector()
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File ~/software/sage-src/local/var/lib/sage/venv-python3.13/lib/python3.13/site-packages/sage/structure/category_object.pyx:856,
in sage.structure.category_object.CategoryObject.getattr_from_category()
855 try:
--> 856 return self._cached_methods[name]
857 except KeyError:

KeyError: '_dense_free_module'

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)
Cell In[1], line 3
1 s = SymmetricFunctions(QQ).s()
2 f = s[Integer(2),Integer(1)]
----> 3 f.to_vector()

File sage/modules/with_basis/indexed_element.pyx:855, in
sage.modules.with_basis.indexed_element.IndexedFreeModuleElement._vector_()
--> 855 free_module = self._parent._dense_free_module(new_base_ring)

File sage/structure/category_object.pyx:850, in
sage.structure.category_object.CategoryObject.__getattr__()
--> 850 return self.getattr_from_category(name)

File sage/structure/category_object.pyx:865, in
sage.structure.category_object.CategoryObject.getattr_from_category()
--> 865 attr = getattr_from_other_class(self, cls, name)

File sage/cpython/getattr.pyx:357, in
sage.cpython.getattr.getattr_from_other_class()
--> 357 raise AttributeError(dummy_error_message)

AttributeError: 'SymmetricFunctionAlgebra_schur_with_category' object
has no attribute '_dense_free_module'
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sage-devel/a69dc5f2-92ea-44d4-b7ed-1832bf81d896n%40googlegroups.com.

Martin R

unread,
Apr 18, 2026, 6:58:43 AMApr 18
to sage-devel
So, that means it is better for development / bug fixing to use disable-editable, right?  Assuming, one cannot fix this for the editable install.

Martin

Dima Pasechnik

unread,
Apr 18, 2026, 2:17:22 PMApr 18
to sage-...@googlegroups.com
On Sat, Apr 18, 2026 at 5:58 AM 'Martin R' via sage-devel
<sage-...@googlegroups.com> wrote:
>
> So, that means it is better for development / bug fixing to use disable-editable, right? Assuming, one cannot fix this for the editable install.
Certainly, it ought to be fixable, possibly by removing old obsolete
code (I'm surprised to see that to get a meaningful traceback from
Cython in ipython, one needs
to call low-level Python API in C, see src/sage/cpython/getattr.pyx)

I've opened https://github.com/sagemath/sage/issues/42033

Dima
> To view this discussion visit https://groups.google.com/d/msgid/sage-devel/8ab0eeb0-a014-4853-a931-b8655830e043n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages