Ask Your Question
1

Updating Sage to python 3.8 or 3.9

asked 4 years ago

Alain Ngalani gravatar image

updated 4 years ago

FrédéricC gravatar image

I'm running an alogorithm that seems to work in sagecell but doesn't work in my version of Sage.

I think that maybe this has to do with the fact my version of Sage uses Python 3.7.7, in the last 2 days I tried everything I could to upgrade the Python version but nothing seems to work.

Also I find quite odd that it installs Python 3.7.7 given how on the release notes of Sage 9.2 it states that the program comes with its own copy of python 3.8.5.

Do you know how can I solve?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 4 years ago

Sébastien gravatar image

updated 4 years ago

According to the documentation, during the compilation of SageMath "by default, Sage will try to use system’s python3". In your case, it finds the Python 3.7.7.

Did you compile SageMath from source? If yes, you may force the usage of the Python which is shipped with SageMath instead of the one found on the system by doing:

make configure
./configure --without-system-python3
MAKE='make -j8' make

Or, you may force the usage of some version of python on your system by using instead:

make configure
./configure --with-python=/usr/bin/python3.8
MAKE='make -j8' make

...assuming your Python 3.8 is at this place:

$ which python3.8
/usr/bin/python3.8
Preview: (hide)
link

Comments

I compiled form binary

Alain Ngalani gravatar imageAlain Ngalani ( 4 years ago )

Exactly which binary did you install?

John Palmieri gravatar imageJohn Palmieri ( 4 years ago )

I tried with 6.2 (sage 9.2), 6.1 (sage 9.2) and 6 (sage 9). No difference but in the fact that installing sage 9 it comes with Python 3.7.3 so even older

Alain Ngalani gravatar imageAlain Ngalani ( 4 years ago )

I don't know what "6.2" (etc.) means. Can you tell us the precise name of the binary file that you downloaded? Or at least tell us what operating system you're using?

John Palmieri gravatar imageJohn Palmieri ( 4 years ago )
1

In any case, the easiest way to use a particular version of Python is to make sure that version of Python is installed on your system, and then build Sage from scratch.

John Palmieri gravatar imageJohn Palmieri ( 4 years ago )
0

answered 4 years ago

Emmanuel Charpentier gravatar image

Python 3.9 is supported by Sage 9.2, which comes indeed with some version of 3.8 (this is what is used when Sage can't find (or instructed to ignore) a suitable systemwide Python).

The upgrade to 3.9.1 was accepted 5 weeks ago (i. e. 9.3.betasomething), and an effort is underway to upgrade this to Python 9.2 (this ticket currently needs_review : you are welcome to contribute a test on your configuration...).

What leads you to the conclusion that the Python version is responsible for your difficulties ?

Preview: (hide)
link

Comments

The fact that a given code works in sageCell but not on the version of sage I've in my pc.

Also I have both Python 3.8.8 and 3.9.something on my system but still it uses 3.7.7

Alain Ngalani gravatar imageAlain Ngalani ( 4 years ago )

Maybe you can just uninstall python 3.7 from your system?

Max Alekseyev gravatar imageMax Alekseyev ( 4 years ago )

It doesn't seem to work, I removed every version (and checked by console that there was indeed none), then installed a new version (3.8.8.) but still nothing

Alain Ngalani gravatar imageAlain Ngalani ( 4 years ago )

Did you rebuild Sage after this Python cleanup ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 4 years ago )

I tried reinstalling it and even download again. I also tried building from source but I'unabke to, I try typing the comants into windows prompt and nothing happens that should happen

Alain Ngalani gravatar imageAlain Ngalani ( 4 years ago )

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: 4 years ago

Seen: 2,619 times

Last updated: Mar 06 '21