Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Running Sage from an IDE like PyCharm on Windows. #12

Closed
PHPirates opened this issue Dec 15, 2017 · 6 comments
Closed

Running Sage from an IDE like PyCharm on Windows. #12

PHPirates opened this issue Dec 15, 2017 · 6 comments

Comments

@PHPirates
Copy link

I already tried asking at SO and ask.sagemath.org but I couldn't reach any Windows users of Sage, maybe there are some here?

My question:
In order to make Sage really a success for me I want a proper IDE. I want to be able to edit and run Sage scripts with PyCharm.

I think there exist people running this setup on Linux, so I think it should be possible on Windows as well.

My attempt currently consists of running inside the Sage shell

SAGE_ROOT="C:/Program Files/SageMath 8.0/runtime/opt/sagemath-8.0"
sage -sh
cd "C:/Program Files/JetBrains/PyCharm 2017.2.3/bin"
./pycharm.exe

In the PyCharm project I selected my system wide python2.7 as interpreter, but I get no module named sage.all which makes sense because I didn't install the module into my system wide python.

After sage -sh I checked with printenv SAGE_ROOT that the environment variable was set correctly.

I did figure out that Sage's sage.all module is installed in Sage's python, at C:\Program Files\SageMath 8.0\runtime\opt\sagemath-8.0\local\lib\python2.7\site-packages\sage. But PyCharm does not want to recognise Sage's python as a valid interpreter.

I also tried setx PYTHONPATH "C:/Program Files/SageMath 8.0/runtime/opt/sagemath-8.0/local/lib/python2.7/site-packages/sage" /M (sets the system environment variable) in the hope that it would make python find the packages,

I also figured that it didn't make sense to just copy the sage module into my system wide python installation, because the module makes use of for example os.uname which is not available on Windows. That said, I have no clue at all how the Sage console even works :)

PS Actually this is the only thing withholding me from spreading Sage in my university, since the console and SageTeX work fine - although the console takes 45 secs up to a minute to start and SageTeX instructions are not made for windows.
PPS Glad to see that since I installed Sage from here the number of stars went from 2 to 16, keep it going :)
PPPS Just saw you have released Sage 8.1 an hour ago, not sure if that affects anything. Will update Sage later.

@haraldschilly
Copy link
Member

Yes, pycharm support is something I want to have, too. You should ask this at the https://groups.google.com/forum/#!forum/sage-devel mailing list, because at least in for the unix-like systems I know that some got it working. There are likely specific challenges for windows..

@PHPirates
Copy link
Author

PHPirates commented Dec 15, 2017

Thanks, good idea. I'll copy to there. I hope I did it right because I can't find back my own post yet.

@slel
Copy link
Member

slel commented Dec 16, 2017

Your post to sage-devel went through. For future reference, it is at
https://groups.google.com/d/topic/sage-devel/iKQY5Em-QpY/discussion

@dimpase
Copy link
Member

dimpase commented Dec 16, 2017

Well, unfortunately JB does not want to support Cygwin's Python, and thus you are out of luck in the present setup (which is actually using a customised Cygwin Python).

Perhaps more luck with configuring this as a remote Python, I don't know.

@PHPirates
Copy link
Author

PHPirates commented Dec 16, 2017

@slel thx I saw your comment about Jupyter on SO which explained it well.

But as I said in the sage-devel Google Groups discussion, I am looking for an IDE which also works with version control system, I forgot to specify that in my initial question. But Jupyter is better than nothing, for sure!

@dimpase Thanks for linking to that issue, if anytime in the future I find a workaround I'll be sure to report back!

@embray
Copy link
Contributor

embray commented Dec 18, 2017

I'm going to close this since this issue is really outside the scope of this repository. Feel free to follow up further on the mailinglist/ask.sagemath.org.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants