Ask Your Question
1

PyCharm for SageMath on Linux

asked 2020-04-19 12:45:20 +0200

TK gravatar image

updated 2020-04-19 12:46:19 +0200

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 https://ask.sagemath.org/question/397... or https://ask.sagemath.org/question/387....

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-04-19 14:41:50 +0200

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

Comments

2

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 15:16:29 +0200 )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 09:11:02 +0200 )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 09:27:34 +0200 )edit

Ok. Thank you anyway!

TK gravatar imageTK ( 2020-04-27 06:24:09 +0200 )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

Stats

Asked: 2020-04-19 12:45:20 +0200

Seen: 1,215 times

Last updated: Apr 19 '20