First time here? Check out the FAQ!

Ask Your Question
1

PyCharm for SageMath on Linux

asked 4 years ago

TK gravatar image

updated 4 years ago

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....

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

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.

Preview: (hide)
link

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 ( 4 years ago )

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 ( 4 years ago )

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 ( 4 years ago )

Ok. Thank you anyway!

TK gravatar imageTK ( 4 years ago )

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: 4 years ago

Seen: 1,738 times

Last updated: Apr 19 '20