2

Why do the installation of Sagemath fails on Ubuntu? I tried

jaakko@jaakko-Aspire-E1-572:~$ sudo apt install sagemath-common
[sudo] password for jaakko: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  sagemath-common
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 16,2 MB of archives.
After this operation, 205 MB of additional disk space will be used.
Get:1 http://fi.archive.ubuntu.com/ubuntu focal/universe amd64 sagemath-common all 9.0-1ubuntu4 [16,2 MB]
Fetched 16,2 MB in 4s (3 888 kB/s)            
Selecting previously unselected package sagemath-common.
(Reading database ... 216481 files and directories currently installed.)
Preparing to unpack .../sagemath-common_9.0-1ubuntu4_all.deb ...
Unpacking sagemath-common (9.0-1ubuntu4) ...
Setting up sagemath-common (9.0-1ubuntu4) ...
/usr/lib/python3/dist-packages/sage/combinat/root_system/branching_rules.py:1753
: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if len(stypes) is not 2:
/usr/lib/python3/dist-packages/sage/graphs/graph_latex.py:1159: SyntaxWarning: '
str' object is not callable; perhaps you missed a comma?
  raise TypeError('%s option must be a dictionary, not %s' (name, value))
/usr/lib/python3/dist-packages/sage/graphs/graph_latex.py:1168: SyntaxWarning: '
str' object is not callable; perhaps you missed a comma?
  raise TypeError('%s option must be a dictionary, not %s' (name, value))
/usr/lib/python3/dist-packages/sage/graphs/graph_latex.py:1175: SyntaxWarning: '
str' object is not callable; perhaps you missed a comma?
  raise TypeError('%s option must be a dictionary, not %s' (name, value))
/usr/lib/python3/dist-packages/sage/graphs/graph_latex.py:1182: SyntaxWarning: '
str' object is not callable; perhaps you missed a comma?
  raise TypeError('%s option must be a dictionary, not %s' (name, value))
/usr/lib/python3/dist-packages/sage/graphs/graph_latex.py:1189: SyntaxWarning: '
str' object is not callable; perhaps you missed a comma?
  raise TypeError('%s option must be a dictionary, not %s' (name, value))
/usr/lib/python3/dist-packages/sage/graphs/graph_latex.py:1196: SyntaxWarning: '
str' object is not callable; perhaps you missed a comma?
  raise TypeError('%s option must be a dictionary, not %s' (name, value))
/usr/lib/python3/dist-packages/sage/graphs/graph_latex.py:1203: SyntaxWarning: '
str' object is not callable; perhaps you missed a comma?
  raise TypeError('%s option must be a dictionary, not %s' (name, value))
Processing triggers for man-db (2.9.1-1) ...
jaakko@jaakko-Aspire-E1-572:~$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.8.5. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
Traceback (most recent call last):
  File "/usr/share/sagemath/bin/sage-ipython", line 12, in <module>
    from sage.repl.interpreter import SageTerminalApp
  File "/usr/lib/python3/dist-packages/sage/repl/interpreter.py", line 105, in <module>
    from sage.repl.preparse import preparse, containing_block
  File "/usr/lib/python3/dist-packages/sage/repl/preparse.py", line 227, in <module>
    from sage.repl.load import load_wrap
  File "/usr/lib/python3/dist-packages/sage/repl/load.py", line 19, in <module>
    from sage.cpython.string import str_to_bytes, bytes_to_str, FS_ENCODING
ModuleNotFoundError: No module named 'sage.cpython.string'
jaakko@jaakko-Aspire-E1-572:~$ 
2
  • 1
    Please add output of apt-cache policy python-is-python2 python-is-python3 ; which python; which python2; which python3 to the question. – N0rbert Mar 12 at 11:23
  • It is not necessary. The solution was to install sagemath instead of sagemath-common. – Jaakko Seppälä Mar 12 at 11:45
4

To install Sage Math, enter the command sudo apt install sagemath.

sagemath-common (which you installed) is one of the dependencies of the whole package. When you install sagemath, it would install all the required dependencies.

3
  • Seems to be a problem with python-is-python2 or python-is-python3 in this current case. – N0rbert Mar 12 at 10:59
  • @N0rbert Sorry, I did not understand your comment. Is it that sage makes call for python but expects python3 (while Ubuntu provides it python2) ? Then this could be fixed by installing python-is-python3. – Archisman Panigrahi Mar 12 at 11:20
  • Understood, great! – N0rbert Mar 12 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.