How do I run sage in python3?

655 views
Skip to first unread message

Dew Debra

unread,
Oct 23, 2021, 1:55:35 PM10/23/21
to sage-support
I want to run sage scripts using python3
i installed in Ubuntu 18.04
through the command

  sudo apt-get install sagemath

  then using  the sage module into a file
 
from sage.all import *

but the script was launched only in  python2  , but can I run it in python3?


How do I run sage in python3?

Jan Groenewald

unread,
Oct 23, 2021, 2:40:18 PM10/23/21
to sage-support
How did you start python?

(and I guess why not use sage directly, but that is another question.

Run in a terminal:

python3
or
ipython3
or
jupyter notebook

... then try again.

Regards,
Jan

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/daa9a26d-e040-4ed7-b3ea-0694e4b542d6n%40googlegroups.com.


--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^ 

Dew Debra

unread,
Oct 23, 2021, 4:32:03 PM10/23/21
to sage-support
I use google colab to work with sage. Unfortunately google colab only gives Ubuntu 18.04 version. How can this problem be solved?

суббота, 23 октября 2021 г. в 21:40:18 UTC+3, Jan Groenewald:

Nils Bruin

unread,
Oct 23, 2021, 4:48:53 PM10/23/21
to sage-support
I think Ubuntu 18.04 might only have an old, python2-based, version of sagemath packaged:


https://www.sagemath.org/download.html does host binary builds for 18.04, so downloading from there could get you version 9.4, which does run on python3. Or you can build from source.
Reply all
Reply to author
Forward
0 new messages