Ask Your Question

PyCharm for SageMath on Linux

asked 2020-04-19 05:45:20 -0500

TK gravatar image

updated 2020-04-19 05:46:19 -0500

I am looking for an IDE with syntax highlighting, code completion and debugging support to run SageMath 9.0 with preprocessing on (Arch) Linux.

The two most obvious choices seem to be PyCharm and Eclipse, but PyCharm is not able to do from sage.all import * even though my SAGE_ROOT="/usr" and I am running pycharm from a sage -shas described in or

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-04-19 07:41:50 -0500

vdelecroix gravatar image

If you use sage from the package manager (pacman) then don't use sage -sh. It is only intended when Sage is installed from source or precompiled binaries from the SageMath website. If the following works in your Python console

>>> from sage.all import *

Then it should just work the same in PyCharm.

edit flag offensive delete link more



The problem was that PyCharm used its own python interpreter, not the /usr/bin/python one. I changed it and now it works.

TK gravatar imageTK ( 2020-04-19 08:16:29 -0500 )edit

Only one problem left: How can I use Sage specific syntax (^ instead of **, for example) in PyCharm when not using sage -sh?

TK gravatar imageTK ( 2020-04-23 02:11:02 -0500 )edit

Indeed. SageMath has an internal preparser (input commands are transformed before being sent to Python, one of them is the substitution ^ -> **). I don't think it is possible to plug that in the Python interpreter. But I believe it is doable with IPython. I am not familiar enough with that process to help you more.

vdelecroix gravatar imagevdelecroix ( 2020-04-23 02:27:34 -0500 )edit

Ok. Thank you anyway!

TK gravatar imageTK ( 2020-04-26 23:24:09 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-04-19 05:45:20 -0500

Seen: 132 times

Last updated: Apr 19