Processing Math: Done
No jsMath TeX fonts found -- using unicode fonts instead.
This may be slow and might not print well.
Use the jsMath control panel to get additional information.
jsMath Control PanelHide this Message


jsMath
Differences between revisions 12 and 13
Revision 12 as of 2019-10-30 13:44:31
Size: 1945
Editor: chapoton
Comment:
Revision 13 as of 2019-10-30 15:37:23
Size: 1949
Editor: chapoton
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
The change from Python2 to Python3 has already been made by all major scientific software based on Python, including !NumPy, !SciPy and Jupyter. It becomes more and more common for scientific Python software to work only under Python3. Moreover, the official end of life for Python 2 is the end of 2019 (see the [[https://pythonclock.org/|countdown]]) The change from Python 2 to Python 3 has already been made by all major scientific software based on Python, including !NumPy, !SciPy and Jupyter. It becomes more and more common for scientific Python software to work only under Python 3. Moreover, the official end of life for Python 2 is the end of 2019 (see the [[https://pythonclock.org/|countdown]])
Line 25: Line 25:
After version 9.0, you can still build and use !SageMath with '''Python2''', as follows. After version 9.0, you can still build and use !SageMath with '''Python 2''', as follows.

Summary of the Python 3 switch

SageMath has been running on top of Python 2 since the beginning, until version 8.9, released in september 2019.

Starting from version 9.0 (to be released later in 2019 or early 2020), SageMath will be running on top of Python 3.

The change from Python 2 to Python 3 has already been made by all major scientific software based on Python, including NumPy, SciPy and Jupyter. It becomes more and more common for scientific Python software to work only under Python 3. Moreover, the official end of life for Python 2 is the end of 2019 (see the countdown)

For all these reasons, it is necessary for SageMath to switch to Python 3. After a lot of work and a lot of time, this is now possible and will be done in the 9.0 version.

This will not be without pain for the users of SageMath. Python 3 has some major backward incompatibilities with Python2, and adapting the code takes some care and some work.

Some basic instructions for doing that can be found in the page Python3-compatible code.

Some more specific details follow.

Old notebooks

The "legacy Sage notebook", which was used by Sage for a long time, has been replaced by the Jupyter notebook since 2010 ????. Because the legacy notebook is no longer maintained, it is not compatible with Python 3 and will not be available in versions 9.0 and higher of SageMath.

All people that still have old-style notebooks are urged to migrate them to Jupyter notebooks now.

Compiling with Python 2

After version 9.0, you can still build and use SageMath with Python 2, as follows.

make configure
./configure --with-python=2
make build

Beware that you will need to call the second line again if you ever call "make distclean".

This will work until version 9.1 at least. Then the backward compatibility with Python 2 will no longer be ensured.

Python3-Switch (last edited 2021-02-09 13:32:40 by chapoton)