Using Pycharm with sage via Anaconda seamlessly

asked 2024-06-25 03:18:12 +0200

marco-david gravatar image

I'm working on a project with sage 10.2 through PyCharm 2023.1.2. My sage distribution is installed through an anaconda environment which contains all my project's dependencies.

While executing code works thanks to import sage.all lines at the top of many of my source files, the syntax parsing is far from optimal, with Pycharm not recognizing several imports such as:

from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular
from sage.rings.integer_ring import ZZ

The two files which are being referred to in this example exist only as .pyx and .pxd files, but there is no Pure python file which Pycharm would automatically detect.

Are there any tips to make this integration with sage and Cython work seamlessly?

PS. A related issue appears in the Jupyter notebooks I use as part of the development. Here, importing my top "API-level" source file in turn imports many more imports and dependencies. Pycharm's Jupyter notebook client shows these names as unresolved, however, even after executing the import cell. Do you know any (additional) fixes to make this integration also work seamlessly?

edit retag flag offensive close merge delete