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.Mon, 08 Oct 2018 10:56:31 -0500Differences between Python2 Sagemath and Python3 Sagemath?http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/ With sagemath looking to move away from python2 in 2020 and as a new user of sagemath, I wanted to know what the differences are between Python2 Sagemath and Python3 Sagemath?
At the moment sagemath is not fully compatible with python3 and I have been told to expect problems. I want to know how serious these problems are and how frequent they are. I would then be able to know if using python3 sagemath is worth the trouble.Wed, 11 Jul 2018 14:35:20 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/Comment by slelievre for <p>With sagemath looking to move away from python2 in 2020 and as a new user of sagemath, I wanted to know what the differences are between Python2 Sagemath and Python3 Sagemath? </p>
<p>At the moment sagemath is not fully compatible with python3 and I have been told to expect problems. I want to know how serious these problems are and how frequent they are. I would then be able to know if using python3 sagemath is worth the trouble.</p>
http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=43871#post-id-43871William Stein just made it very easy to test the latest Sage built with Python 3:
- [ask to be added to a CoCalc project to play with Sage built with Python 3](https://share.cocalc.com/share/d282680a-dda9-486c-87fe-d7f4331bbf53/README.md?viewer=share)Mon, 08 Oct 2018 10:56:31 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=43871#post-id-43871Comment by Iguananaut for <p>With sagemath looking to move away from python2 in 2020 and as a new user of sagemath, I wanted to know what the differences are between Python2 Sagemath and Python3 Sagemath? </p>
<p>At the moment sagemath is not fully compatible with python3 and I have been told to expect problems. I want to know how serious these problems are and how frequent they are. I would then be able to know if using python3 sagemath is worth the trouble.</p>
http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42957#post-id-42957In the future there will likely be benefits. I could see major benefits, for example, from the use of function annotations, the matmul operator, and things like that. But until Sage drops Python 2 support there won't be any major features that rely on Python 3 most likely.Thu, 12 Jul 2018 07:19:26 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42957#post-id-42957Answer by John Palmieri for <p>With sagemath looking to move away from python2 in 2020 and as a new user of sagemath, I wanted to know what the differences are between Python2 Sagemath and Python3 Sagemath? </p>
<p>At the moment sagemath is not fully compatible with python3 and I have been told to expect problems. I want to know how serious these problems are and how frequent they are. I would then be able to know if using python3 sagemath is worth the trouble.</p>
http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?answer=42939#post-id-42939The most reliable way to use Sage right now is with its default Python 2. Before it moves to Python 3, all of the problems will have to be worked out. How frequently you will run into problems, and how serious those problems will be, depends on what you want to do. If you run Sage's doctests, you will see lots of failures, but there are also lots of successes. Running the doctests is one good way to see where there are problems. Just using Sage is another.
This is the best answer that I can give unless you specify how you plan to use Sage — graph theory? simplicial complexes? calculus? something else — and unless you quantify, or at least clarify, what you mean by "worth the trouble".
Thu, 12 Jul 2018 00:08:35 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?answer=42939#post-id-42939Comment by John Palmieri for <p>The most reliable way to use Sage right now is with its default Python 2. Before it moves to Python 3, all of the problems will have to be worked out. How frequently you will run into problems, and how serious those problems will be, depends on what you want to do. If you run Sage's doctests, you will see lots of failures, but there are also lots of successes. Running the doctests is one good way to see where there are problems. Just using Sage is another.</p>
<p>This is the best answer that I can give unless you specify how you plan to use Sage — graph theory? simplicial complexes? calculus? something else — and unless you quantify, or at least clarify, what you mean by "worth the trouble".</p>
http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42965#post-id-42965At this point, the only reasons to use Python 3 with Sage are: because you have a compelling reason to use Python 3 syntax rather than Python 2, and/or because you want to help make Sage compatible with Python 3. I don't know of any particular "better functionality" with Sage + Python 3.Thu, 12 Jul 2018 10:09:42 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42965#post-id-42965Comment by number123 for <p>The most reliable way to use Sage right now is with its default Python 2. Before it moves to Python 3, all of the problems will have to be worked out. How frequently you will run into problems, and how serious those problems will be, depends on what you want to do. If you run Sage's doctests, you will see lots of failures, but there are also lots of successes. Running the doctests is one good way to see where there are problems. Just using Sage is another.</p>
<p>This is the best answer that I can give unless you specify how you plan to use Sage — graph theory? simplicial complexes? calculus? something else — and unless you quantify, or at least clarify, what you mean by "worth the trouble".</p>
http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42966#post-id-42966I deleted python3 sage and restarted with python2, now I am getting a different error when running tests with `SAGE_CHECK=yes`.Thu, 12 Jul 2018 10:41:11 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42966#post-id-42966Comment by number123 for <p>The most reliable way to use Sage right now is with its default Python 2. Before it moves to Python 3, all of the problems will have to be worked out. How frequently you will run into problems, and how serious those problems will be, depends on what you want to do. If you run Sage's doctests, you will see lots of failures, but there are also lots of successes. Running the doctests is one good way to see where there are problems. Just using Sage is another.</p>
<p>This is the best answer that I can give unless you specify how you plan to use Sage — graph theory? simplicial complexes? calculus? something else — and unless you quantify, or at least clarify, what you mean by "worth the trouble".</p>
http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42940#post-id-42940Yes I already encountered failures referencing docs when running `make ptest` for sagemath compiled with python3. Can you confirm what failing the doctests means? I assume it means that I would have to look for documentation on the sagemath website instead.
I plan to use sage for calculus and vector calculus, ODES, algebra, Linear Algebra, Geometry. By worth the trouble I mean that do the gains from using sagemath python3 out weigh the problems one might encounter. For example, if the only issue is lack of an integrated documentation, then I would say using sagemath python 3 is worth the trouble (if it has better functionality) because I could always find documentation on the official sagemath website.Thu, 12 Jul 2018 04:09:20 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42940#post-id-42940Answer by slelievre for <p>With sagemath looking to move away from python2 in 2020 and as a new user of sagemath, I wanted to know what the differences are between Python2 Sagemath and Python3 Sagemath? </p>
<p>At the moment sagemath is not fully compatible with python3 and I have been told to expect problems. I want to know how serious these problems are and how frequent they are. I would then be able to know if using python3 sagemath is worth the trouble.</p>
http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?answer=42942#post-id-42942This answer might soon become obsolete, so let me emphasise that it is
written on 2018-07-12.
Porting Sage to Python 3 is work in progress.
As far as I know, a Python3-based Sage currently has no extra functionality.
Using it is a sign of enthusiasm for the development of Sage.
The casual user is expected to stick to Python2-based Sage for now.
Running `make test`, `make testlong`, `make ptest`, `make ptestlong`
is a way to check whether all the examples and tests in Sage's documentation
work as expected. So far, these will not succeed with a Python3-based Sage;
they will help developers know what still needs to be worked on for porting
Sage to Python3.
To learn more about the doctesting framework in Sage, read:
- [Doctesting page in the developer manual](https://doc.sagemath.org/html/en/developer/doctesting.html),
especially
[this section](https://doc.sagemath.org/html/en/developer/doctesting.html#parallel-testing-the-whole-sage-library)
- ["Testing" section of the "Coding basics" page in the developer manual](https://doc.sagemath.org/html/en/developer/coding_basics.html#chapter-testing)
For more about Sage and Python3, see other
[questions tagged `Python3.x` on Ask Sage](https://ask.sagemath.org/questions/tags:Python3.x).Thu, 12 Jul 2018 04:38:58 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?answer=42942#post-id-42942Comment by number123 for <p>This answer might soon become obsolete, so let me emphasise that it is
written on 2018-07-12.</p>
<p>Porting Sage to Python 3 is work in progress.</p>
<p>As far as I know, a Python3-based Sage currently has no extra functionality.</p>
<p>Using it is a sign of enthusiasm for the development of Sage.</p>
<p>The casual user is expected to stick to Python2-based Sage for now.</p>
<p>Running <code>make test</code>, <code>make testlong</code>, <code>make ptest</code>, <code>make ptestlong</code>
is a way to check whether all the examples and tests in Sage's documentation
work as expected. So far, these will not succeed with a Python3-based Sage;
they will help developers know what still needs to be worked on for porting
Sage to Python3.</p>
<p>To learn more about the doctesting framework in Sage, read:</p>
<ul>
<li><a href="https://doc.sagemath.org/html/en/developer/doctesting.html">Doctesting page in the developer manual</a>,
especially
<a href="https://doc.sagemath.org/html/en/developer/doctesting.html#parallel-testing-the-whole-sage-library">this section</a></li>
<li><a href="https://doc.sagemath.org/html/en/developer/coding_basics.html#chapter-testing">"Testing" section of the "Coding basics" page in the developer manual</a></li>
</ul>
<p>For more about Sage and Python3, see other
<a href="https://ask.sagemath.org/questions/tags:Python3.x">questions tagged <code>Python3.x</code> on Ask Sage</a>.</p>
http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42947#post-id-42947@slelievre thanks for finally clarifying what `make ptest` actually does. Previously I assumed that my python3 sage was failing `make ptest` only due to the documentation failing to build properly when using python3. Now I understand that it actually runs examples from different areas in mathematics. This means that if my use cases are calculus, vector calculus, ODES, algebra, Linear Algebra, Geometry and probability then using sage built with python3 will most likely not work adequately for some of these cases or even all.Thu, 12 Jul 2018 05:45:34 -0500http://ask.sagemath.org/question/42932/differences-between-python2-sagemath-and-python3-sagemath/?comment=42947#post-id-42947