I already tried asking at SO 
<https://stackoverflow.com/questions/47378147/use-pycharm-to-run-sagemath-scripts>and
 
ask.sagemath.org 
<https://ask.sagemath.org/question/39742/use-pycharm-to-edit-and-run-sage-scripts/>
 
but I couldn't reach any Windows users of Sage, then I tried at the GitHub 
Windows release repo <https://github.com/sagemath/sage-windows/issues/12> with 
results of the previous questions and there someone referred me here so 
here is the copy of my question:

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. How do I do this on 
Windows?*

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.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to