Ask Your Question

pb installing sagemath ubuntu from pre-built binaries

asked 2021-10-22 18:22:39 +0200

bruno gravatar image


I try unsuccessfully to install sagemath on my labtop. I download sage-9.4-Ubuntu_20.04-x86_64.tar.bz2 on the official website and then extract in /home/bruno. Then, following the instructions, I open a terminal, get to /bruno/Sagemath, then type ./sage and get

bruno@bruno:~/SageMath$ ./sage /usr/bin/env: «python»: Aucun fichier ou dossier de ce type Error running the script ''.

I don't know what to do to fix the issue. I try to google that but could not find a solution that i can understan.

Thank you for your help.

edit retag flag offensive close merge delete


Try to edit the first line of the script change "python" to "python3". Does that help?

John Palmieri gravatar imageJohn Palmieri ( 2021-10-22 18:38:51 +0200 )edit
John Palmieri gravatar imageJohn Palmieri ( 2021-10-22 18:39:18 +0200 )edit

it works !!!! thanks a lot.

bruno gravatar imagebruno ( 2021-10-22 19:33:01 +0200 )edit

Another option is to install the Ubuntu package python-is-python3 before running sage for the first time.

eric_g gravatar imageeric_g ( 2021-10-24 14:12:42 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2021-10-22 20:04:54 +0200

tmonteil gravatar image

updated 2021-10-22 22:06:20 +0200

The problem comes from the fact that in Debian-related distros, python command was refering to the Python 2 interpreter and python3 was used for Python 3. Now that Python 2 disapeared, there is no command named python anymore, and it is not so bad that redirecting this command to Python 3 interpreter is not automatic (at least for now), to avoid confusions with scripts relying on Python 2, and also because it is still possible to install Python 2 interpreter.

The simplest way to let the command python run Python 3 interpreter is to install the package python-is-python3:

sudo apt install python-is-python3

which basically just adds a symlink /usr/bin/python -> /usr/bin/python3.

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


Asked: 2021-10-22 18:22:39 +0200

Seen: 192 times

Last updated: Oct 22 '21