Error building package python3-3.8.5

208 views
Skip to first unread message

Günter Rote

unread,
Jan 2, 2021, 12:45:58 PM1/2/21
to sage-devel
************************************************************************
Error building package python3-3.8.5
************************************************************************
Please email sage-devel (http://groups.google.com/group/sage-devel)
explaining the problem and including the log file
  /home/rote/Dokumente/sage/logs/pkgs/python3-3.8.5.log
Describe your computer, operating system, etc.


======

I downloaded today the Branch "develop"
I am running under
Ubuntu 18.04

Could not make sage.

(I have python 3.8.0 installed anyway, but sage wants to install its own more recent version, apparently.) 
python3-3.8.5.log

Matthias Koeppe

unread,
Jan 2, 2021, 1:55:15 PM1/2/21
to sage-devel
On Saturday, January 2, 2021 at 9:45:58 AM UTC-8 roteg...@gmail.com wrote:
Error building package python3-3.8.5
[...]

I downloaded today the Branch "develop"
I am running under
Ubuntu 18.04

Could not make sage.

From the log:

*** WARNING: renaming "readline" since importing it failed: /home/rote/Dokumente/sage/local/lib/libreadline.so.8: undefined symbol: UP Python build finished successfully! The necessary bits to build these optional modules were not found: _dbm _gdbm _tkinter To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Following modules built successfully but were removed because they could not be imported: readline running build_scripts creating build/scripts-3.8 copying and adjusting /home/rote/Dokumente/sage/local/var/tmp/sage/build/python3-3.8.5/src/Tools/scripts/pydoc3 -> build/scripts-3.8 copying and adjusting /home/rote/Dokumente/sage/local/var/tmp/sage/build/python3-3.8.5/src/Tools/scripts/idle3 -> build/scripts-3.8 copying and adjusting /home/rote/Dokumente/sage/local/var/tmp/sage/build/python3-3.8.5/src/Tools/scripts/2to3 -> build/scripts-3.8 changing mode of build/scripts-3.8/pydoc3 from 644 to 755 changing mode of build/scripts-3.8/idle3 from 644 to 755 changing mode of build/scripts-3.8/2to3 from 644 to 755 renaming build/scripts-3.8/pydoc3 to build/scripts-3.8/pydoc3.8 renaming build/scripts-3.8/idle3 to build/scripts-3.8/idle3.8 renaming build/scripts-3.8/2to3 to build/scripts-3.8/2to3-3.8 Testing importing of various modules... ctypes module imported OK math module imported OK hashlib module imported OK crypt module imported OK Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'readline' readline module failed to import socket module imported OK zlib module imported OK sqlite3 module imported OK Error: One or more modules failed to import.  

This might be a problem with ncurses.

(I have python 3.8.0 installed anyway, but sage wants to install its own more recent version, apparently.) 

Please post config.log, which will also explain why system python 3.8 was not accepted by Sage.

 

Günter Rote

unread,
Jan 2, 2021, 2:33:33 PM1/2/21
to sage-devel
My mistake: I installed Python 3.8 after running configure
The build is running now smoothly. (so far)

Günter Rote

unread,
Jan 3, 2021, 5:12:14 AM1/3/21
to sage-devel
I am posting config.log.

(I had linked /usr/bin/python3 to /usr/bin/python3.8, and then the sage build went through without problems.
But then I ran into a different problem: I could not open a terminal window. After a frightening hour, I
discovered the reason: /usr/bin/gnome-terminal could not find some library on line 8:
#!/usr/bin/python3

import string
import subprocess
import sys
import random

from argparse import ArgumentParser, SUPPRESS
from gi.repository import GLib, Gio
...

Now I have switched back /usr/bin/python3 to /usr/bin/python3.6, but now sage won't build any more.


Matthias Koeppe schrieb am Samstag, 2. Januar 2021 um 19:55:15 UTC+1:
config.log

Dima Pasechnik

unread,
Jan 3, 2021, 5:41:57 AM1/3/21
to sage-devel
There is a way to configure Sage to use any Python3, e.g. to use
python3.8 (assuming this is how your Python 3.8 executable
is called)

./configure --with-python=python3.8

(and then of course you'd have to rebuild all the python packages of Sage)

Needless to say, modifying /usr/bin/python3 is not a good idea - as
you discovered.

HTH
Dima
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/b0395701-5f00-4f34-ba4b-99c0cc7e973an%40googlegroups.com.

Matthias Koeppe

unread,
Jan 3, 2021, 1:42:36 PM1/3/21
to sage-devel
On Sunday, January 3, 2021 at 2:12:14 AM UTC-8 roteg...@gmail.com wrote:
I am posting config.log.

From the log:
....
configure:31101: no suitable system package found for SPKG xz 
...
## Checking whether SageMath should install SPKG python3... 
configure:31215: checking whether any of libpng bzip2 xz libffi is installed as or will be installed as SPKG 
configure:31219: result: yes; install python3 as well configure:31854: no suitable system package found for SPKG python3 
...

To get Sage to accept system python3 (see Dima's message for how to select the version you want to use), xz is needed too.
At the end of ./configure you will see a list of system packages that can be installed - which includes the package providing xz.




brettpim

unread,
Feb 25, 2021, 5:20:16 PM2/25/21
to sage-devel
I am having a similar problem.  I have pulled the master branch from git and I when run

# ./configure

it finishes with

configure: notice: the following SPKGs did not find equivalent system packages: boost cbc coxeter3 gp2c isl libnauty libsemigroups pari_elldata pari_galpol pari_nftables pari_seadata python3 tox
checking for the package system in use... debian
configure: hint: installing the following system packages is recommended and may avoid building some of the above SPKGs from source:
configure:   $ sudo apt-get update
  $ sudo apt-get install libboost-dev coinor-cbc coinor-libcbc-dev pari-gp2c libisl-dev libnauty-dev python3 libpython3-dev python3-distutils

but all these APT packages are already installed:

# apt-get install libboost-dev coinor-cbc coinor-libcbc-dev pari-gp2c libisl-dev libnauty-dev python3 libpython3-dev python3-distutils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libnauty2-dev' instead of 'libnauty-dev'
libboost-dev is already the newest version (1.71.0.0ubuntu2).
libisl-dev is already the newest version (0.22.1-1).
libpython3-dev is already the newest version (3.8.2-0ubuntu2).
python3 is already the newest version (3.8.2-0ubuntu2).
coinor-cbc is already the newest version (2.10.3+repack1-1build1).
coinor-libcbc-dev is already the newest version (2.10.3+repack1-1build1).
libnauty2-dev is already the newest version (2.6r10+ds-1ubuntu1).
pari-gp2c is already the newest version (0.0.11pl2-3).
python3-distutils is already the newest version (3.8.5-1~20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

I don;t know what I need to get ./configure to recognize my python3. The 'xz' package Matthias refers to is installed:

configure:30241: checking for xz >= 4.999.0
configure:30320: result: /usr/bin/xz
configure:30329: will use system package and not install SPKG xz


config.log attached


config.log

Dima Pasechnik

unread,
Feb 26, 2021, 5:23:47 AM2/26/21
to sage-devel
from your config.log:

## -------------------------------------------------------- ##
## Checking whether SageMath should install SPKG python3... ##
## -------------------------------------------------------- ##
configure:30455: checking whether any of sqlite libpng bzip2 xz libffi
is installed as or will be installed as SPKG
configure:30459: result: yes; install python3 as well

As you see, xz is only one piece of the puzzle, you also need e.g.
sqlite, which is

## Checking whether SageMath should install SPKG sqlite... ##
## ------------------------------------------------------- ##
configure:30003: sqlite has already been installed by SageMath

same with png:

## Checking whether SageMath should install SPKG sqlite... ##
## ------------------------------------------------------- ##
configure:30003: sqlite has already been installed by SageMath

... etc. Having a system python (which should have all these modules) and
the corresponding libs installed in Sage is a problem, that's why it's rejected.

You need to unistall them all:

make sqlite-clean libpng-clean bzip2-clean xz-clean libffi-clean

and then run

./configure --with-python=python3.8

again

HTH
Dima

>
> configure:30241: checking for xz >= 4.999.0
> configure:30320: result: /usr/bin/xz
> configure:30329: will use system package and not install SPKG xz
>
>
> config.log attached
>
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/5ae392d5-88b2-4016-8e03-702de8327336n%40googlegroups.com.

Samuel Lelievre

unread,
Feb 26, 2021, 5:24:59 AM2/26/21
to sage-devel
In your `config.log`, the report for checking
whether to install the `python3` SPGK reads:

```
## -------------------------------------------------------- ##
## Checking whether SageMath should install SPKG python3... ##
## -------------------------------------------------------- ##
configure:30455: checking whether any of sqlite libpng bzip2 xz libffi is installed as or will be installed as SPKG
configure:30459: result: yes; install python3 as well
configure:31094: no suitable system package found for SPKG python3
```

So the decision for `python3` depends, here, not on whether
a suitable system `python3` exists, but on the status for
`sqlite`, `libpng`, `bzip2`, `xz`, `libffi`.

Here are the corresponding checks in `config.log`:

```
## ------------------------------------------------------- ##
## Checking whether SageMath should install SPKG sqlite... ##
## ------------------------------------------------------- ##
configure:30003: sqlite has already been installed by SageMath
```

```
## ------------------------------------------------------- ##
## Checking whether SageMath should install SPKG libpng... ##
## ------------------------------------------------------- ##
configure:14052: libpng has already been installed by SageMath
```

```
## ------------------------------------------------------ ##
## Checking whether SageMath should install SPKG bzip2... ##
## ------------------------------------------------------ ##
configure:14668: bzip2 has already been installed by SageMath
```

```
## --------------------------------------------------- ##
## Checking whether SageMath should install SPKG xz... ##
## --------------------------------------------------- ##
configure:30190: checking for lzma_raw_decoder in -llzma
configure:30215: g++ -std=gnu++11 -std=gnu++11 -o conftest -g -O2  -Wl,-rpath-link,/home/brett/Projects/SAGE/sage/local/lib -L/home/brett/Projects/SAGE/sage/local/lib -Wl,-rpath,/home/brett/Projects/SAGE/sage/local/lib  conftest.cpp -llzma  -lm  >&5
configure:30215: $? = 0
configure:30224: result: yes
configure:30232: checking lzma.h usability
configure:30232: g++ -std=gnu++11 -std=gnu++11 -c -g -O2  conftest.cpp >&5
configure:30232: $? = 0
configure:30232: result: yes
configure:30232: checking lzma.h presence
configure:30232: g++ -std=gnu++11 -E -std=gnu++11  conftest.cpp
configure:30232: $? = 0
configure:30232: result: yes
configure:30232: checking for lzma.h
configure:30232: result: yes
configure:30241: checking for xz >= 4.999.0
configure:30320: result: /usr/bin/xz
configure:30329: will use system package and not install SPKG xz
```

```
## ------------------------------------------------------- ##
## Checking whether SageMath should install SPKG libffi... ##
## ------------------------------------------------------- ##
configure:23725: checking for LIBFFI
configure:23732: $PKG_CONFIG --exists --print-errors "libffi"
configure:23735: $? = 0
configure:23749: $PKG_CONFIG --exists --print-errors "libffi"
configure:23752: $? = 0
configure:23938: result: yes
configure:23946: will use system package and not install SPKG libffi
```

The `configure` script concludes that it can use system packages
for `xz` and `libffi`; and that `sqlite`, `libpng` and `bzip2`
have already been installed by SageMath, so there is no point
in checking for the existence of corresponding system packages.

The final recommendations emitted by `configure` are slightly off:
it recommends installing every package for which the decision
reached during the checks was not to use the sytem package.
But sometimes, what led to that decision was not the absence
of a suitable system package, but other factors.

Improving that is tracked at

- Sage Trac ticket 29586
  Improve configure's recommendations

If you want Sage to use your system's Python3, maybe you can
uninstall the `sqlite`, `libpng` and `bzip2` SPKGs:

```
$ make sqlite-clean
$ make libpng-clean
$ make bzip2-clean
```

and run `configure` again.

If you want to make sure to use as many system packages
as possible, you might want to uninstall more things with:
```
$ make distclean
```

and run `configure` again.

 

brettpim

unread,
Feb 26, 2021, 10:01:20 AM2/26/21
to sage-devel
Thanks Dima and Samuel.
I did as you suggested and I am a hour into the compile and no errors yet so it is looking good.
brett
Reply all
Reply to author
Forward
0 new messages