ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 04 Sep 2019 18:02:25 -0500Sagemath for Windows: a giant headachehttp://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/Hi everyone,
I've encountered two serious issues when trying to use Sagemath on Windows:
1) It is incompatible with any package that requires Anaconda for installation (e.g. QuTiP, etc..)
2) It is incompatible with popular commercial-grade Python IDE's (e.g. *PyCharm* will not recognize the Sage interpreter)
The reason why this is specific to Windows is because, **on Mac, Sage can be installed through Anaconda** (see [anaconda.org/conda-forge/sage](https://anaconda.org/conda-forge/sage) for details), thus circumventing the above issues. So everything works like a dream on Mac OS X. Here are my questions:
*1) Why is there such a disparity between the Windows and Mac situations?*
*2) Can we expect Anaconda support anytime soon? Or is it a waste of time refreshing the sagemath section of the [conda-forge](https://anaconda.org/conda-forge/sage) site from time to time?*
If anyone knows how any of these issues might be resolved (possibly by not needing to use Anaconda), please let me know! In any case, if I can't resolve these issues, then I am most likely going to revert to using *Mathematica*, which is sad, because I like how Sage is designed.Mon, 02 Sep 2019 23:39:39 -0500http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/Comment by droberts01 for <p>Hi everyone, </p>
<p>I've encountered two serious issues when trying to use Sagemath on Windows: </p>
<p>1) It is incompatible with any package that requires Anaconda for installation (e.g. QuTiP, etc..)</p>
<p>2) It is incompatible with popular commercial-grade Python IDE's (e.g. <em>PyCharm</em> will not recognize the Sage interpreter)</p>
<p>The reason why this is specific to Windows is because, <strong>on Mac, Sage can be installed through Anaconda</strong> (see https://anaconda.org/conda-forge/sage (anaconda.org/conda-forge/sage) for details), thus circumventing the above issues. So everything works like a dream on Mac OS X. Here are my questions:</p>
<p><em>1) Why is there such a disparity between the Windows and Mac situations?</em></p>
<p><em>2) Can we expect Anaconda support anytime soon? Or is it a waste of time refreshing the sagemath section of the https://anaconda.org/conda-forge/sage (conda-forge) site from time to time?</em></p>
<p>If anyone knows how any of these issues might be resolved (possibly by not needing to use Anaconda), please let me know! In any case, if I can't resolve these issues, then I am most likely going to revert to using <em>Mathematica</em>, which is sad, because I like how Sage is designed.</p>
http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?comment=47766#post-id-47766Haha PhD candidate here, definitely will fund, maybe later in my career though!Wed, 04 Sep 2019 18:02:25 -0500http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?comment=47766#post-id-47766Comment by Iguananaut for <p>Hi everyone, </p>
<p>I've encountered two serious issues when trying to use Sagemath on Windows: </p>
<p>1) It is incompatible with any package that requires Anaconda for installation (e.g. QuTiP, etc..)</p>
<p>2) It is incompatible with popular commercial-grade Python IDE's (e.g. <em>PyCharm</em> will not recognize the Sage interpreter)</p>
<p>The reason why this is specific to Windows is because, <strong>on Mac, Sage can be installed through Anaconda</strong> (see https://anaconda.org/conda-forge/sage (anaconda.org/conda-forge/sage) for details), thus circumventing the above issues. So everything works like a dream on Mac OS X. Here are my questions:</p>
<p><em>1) Why is there such a disparity between the Windows and Mac situations?</em></p>
<p><em>2) Can we expect Anaconda support anytime soon? Or is it a waste of time refreshing the sagemath section of the https://anaconda.org/conda-forge/sage (conda-forge) site from time to time?</em></p>
<p>If anyone knows how any of these issues might be resolved (possibly by not needing to use Anaconda), please let me know! In any case, if I can't resolve these issues, then I am most likely going to revert to using <em>Mathematica</em>, which is sad, because I like how Sage is designed.</p>
http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?comment=47758#post-id-47758If you have about 2 to 3 years' worth of funding available for a full time developer I can make Sage installable in anaconda on Windows :) Maybe that would be a better use of your money than that Mathematica license but I don't know!Wed, 04 Sep 2019 05:33:03 -0500http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?comment=47758#post-id-47758Answer by vdelecroix for <p>Hi everyone, </p>
<p>I've encountered two serious issues when trying to use Sagemath on Windows: </p>
<p>1) It is incompatible with any package that requires Anaconda for installation (e.g. QuTiP, etc..)</p>
<p>2) It is incompatible with popular commercial-grade Python IDE's (e.g. <em>PyCharm</em> will not recognize the Sage interpreter)</p>
<p>The reason why this is specific to Windows is because, <strong>on Mac, Sage can be installed through Anaconda</strong> (see https://anaconda.org/conda-forge/sage (anaconda.org/conda-forge/sage) for details), thus circumventing the above issues. So everything works like a dream on Mac OS X. Here are my questions:</p>
<p><em>1) Why is there such a disparity between the Windows and Mac situations?</em></p>
<p><em>2) Can we expect Anaconda support anytime soon? Or is it a waste of time refreshing the sagemath section of the https://anaconda.org/conda-forge/sage (conda-forge) site from time to time?</em></p>
<p>If anyone knows how any of these issues might be resolved (possibly by not needing to use Anaconda), please let me know! In any case, if I can't resolve these issues, then I am most likely going to revert to using <em>Mathematica</em>, which is sad, because I like how Sage is designed.</p>
http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?answer=47748#post-id-47748As far as I understand, SageMath will not be packaged anytime soon for Windows in Conda because SageMath does not work on Windows. Windows does not follow POSIX conventions for threads and signals. This prevent many dependencies of SageMath to not compile at all on Windows. If Windows happen to switch to a POSIX compatible environment it will be a matter of days to get SageMath ported to Windows! Concretely, the miracle that makes SageMath currently "runs" on Windows is Cygwin. It is a thin layer that performs the necessary translations. The drawback is that SageMath uses its own version of Python which is installed inside Cygwin. In particular, you don't have access to Python libraries that would be installed by other means on the system. This is very unfortunate. Though, you can still install Python libraries in the Cygwin enviromnement (using the Python package manager pip).
For question number 2), it should be possible to tweak the configuration of PyCharm to actually make it accept the Cygwin python... I am not familiar enough with PyCharm to make a more precise answer.Tue, 03 Sep 2019 01:57:00 -0500http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?answer=47748#post-id-47748Comment by Iguananaut for <p>As far as I understand, SageMath will not be packaged anytime soon for Windows in Conda because SageMath does not work on Windows. Windows does not follow POSIX conventions for threads and signals. This prevent many dependencies of SageMath to not compile at all on Windows. If Windows happen to switch to a POSIX compatible environment it will be a matter of days to get SageMath ported to Windows! Concretely, the miracle that makes SageMath currently "runs" on Windows is Cygwin. It is a thin layer that performs the necessary translations. The drawback is that SageMath uses its own version of Python which is installed inside Cygwin. In particular, you don't have access to Python libraries that would be installed by other means on the system. This is very unfortunate. Though, you can still install Python libraries in the Cygwin enviromnement (using the Python package manager pip).</p>
<p>For question number 2), it should be possible to tweak the configuration of PyCharm to actually make it accept the Cygwin python... I am not familiar enough with PyCharm to make a more precise answer.</p>
http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?comment=47760#post-id-47760Configuring PyCharm on Windows to use Sage: https://ask.sagemath.org/question/39742/make-pycharm-recognise-the-sage-python-interpreter/?answer=40220#post-id-40220Wed, 04 Sep 2019 05:42:31 -0500http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?comment=47760#post-id-47760Answer by Iguananaut for <p>Hi everyone, </p>
<p>I've encountered two serious issues when trying to use Sagemath on Windows: </p>
<p>1) It is incompatible with any package that requires Anaconda for installation (e.g. QuTiP, etc..)</p>
<p>2) It is incompatible with popular commercial-grade Python IDE's (e.g. <em>PyCharm</em> will not recognize the Sage interpreter)</p>
<p>The reason why this is specific to Windows is because, <strong>on Mac, Sage can be installed through Anaconda</strong> (see https://anaconda.org/conda-forge/sage (anaconda.org/conda-forge/sage) for details), thus circumventing the above issues. So everything works like a dream on Mac OS X. Here are my questions:</p>
<p><em>1) Why is there such a disparity between the Windows and Mac situations?</em></p>
<p><em>2) Can we expect Anaconda support anytime soon? Or is it a waste of time refreshing the sagemath section of the https://anaconda.org/conda-forge/sage (conda-forge) site from time to time?</em></p>
<p>If anyone knows how any of these issues might be resolved (possibly by not needing to use Anaconda), please let me know! In any case, if I can't resolve these issues, then I am most likely going to revert to using <em>Mathematica</em>, which is sad, because I like how Sage is designed.</p>
http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?answer=47759#post-id-47759Piggy-backing on @vdelecroix's answer, I wrote a whole little tutorial on using Sage from PyCharm here: https://ask.sagemath.org/question/39742/make-pycharm-recognise-the-sage-python-interpreter/?answer=40220#post-id-40220
I believe due to some recent changes in Sage its now even easier than that and requires setting fewer environment variables, but I'm not positive. Haven't tested it in a while.
Second, as (former; haven't needed it in a while) user of QuTiP, anaconda is not *required* to install it. You can pip install it into Sage's Python by running
$ pip install 'qutip<4.4.0'
(slight update: it appears QuTiP has at some point ceased continuous integration on Python 2 and have been letting Python 2 support break, despite not announcing anywhere a plan to cease Python 2 support, so it turned out the latest version contains Python 3-only syntax and is broken on Python 2; Sage 9.0 when it's released, will likely be the first to claim support for Python 3, and there will likely be a Python 3 Windows build as well.)
in the Sage shell. All of its dependencies are already included in Sage.
It does suck having to have two copies, and that Sage currently requires its own Python interpreter. But that's something that could be improved if more of Sage's dependencies were ported to native Windows (or if Anaconda added official support for packages built with Cygwin support; ask them they have millions of dollars in DoD funding).Wed, 04 Sep 2019 05:35:45 -0500http://ask.sagemath.org/question/47747/sagemath-for-windows-a-giant-headache/?answer=47759#post-id-47759