Ask Your Question
5

Is it possible to run (may be partially) Sage with Python 3?

asked 2016-06-22 12:52:59 -0600

petRUShka gravatar image

updated 2016-06-22 13:55:29 -0600

I want to run sage with python3. I know that it isn't fully ported, but I want to use already ported functionality and hope it cover my needs.

One particular reason is my necessity to use multiprocessing.pool with lambda function which doesn't work with python 2 and both workarounds seem to not work also.

P.S. I found third workaround which seems to be working.

edit retag flag offensive close merge delete

Comments

Answer is no. Progress towards python3 is slow.

FrédéricC gravatar imageFrédéricC ( 2016-06-23 02:09:07 -0600 )edit
1

Thanks to @FrédéricC, progress has been steady and Sage with Python 3 now works mostly fine!

slelievre gravatar imageslelievre ( 2019-05-28 15:08:56 -0600 )edit

2 answers

Sort by » oldest newest most voted
4

answered 2018-10-09 09:01:51 -0600

slelievre gravatar image

updated 2019-05-28 15:07:26 -0600

(Edited 2019-05-28 after much progress was made thanks to @FrédéricC and a few other developers).

You can download the source for Sage and compile it for Python 3.

For that, change to the directory containing the sources and run

$ make configure
$ ./configure --with-python=3
$ make

Before the documentation was made to build with Python 3, it was advised to run make build instead of make, but this is now fixed.

Making all tests pass is the object of

Note that CoCalc lets you use "Sage Py3" and "Sage development Py3" in the terminal or in CoCalc's .sagews worksheets or in Jupyter.

edit flag offensive delete link more

Comments

To follow progress on the Python 3 front, read the updates @FrédéricC posts on sage-devel.

slelievre gravatar imageslelievre ( 2019-05-28 15:11:19 -0600 )edit
1

answered 2018-10-09 10:42:13 -0600

nbruin gravatar image

There is some old code for wrapping functions in a pickleable jacket: https://trac.sagemath.org/attachment/... and there is code that comes packaged with sage to pickle functions: sage.misc.fpickle (the first one goes through some effort to try and pickle closures correctly as well -- something that lambda functions are likely to be. I'm not sure if the second will handle that). In all cases, beware that while pickle goes through great lengths to be backwards compatible with older versions, this does not at all apply when you pickle code objects.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-06-22 12:52:59 -0600

Seen: 425 times

Last updated: May 28