./sage --python
Python 2.7.13 (default, May 31 2017, 17:36:06)
[GCC 4.9.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/all.py", line 98, in <module>
from sage.rings.all import *
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/rings/all.py", line 54, in <module>
from .number_field.all import *
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/rings/number_field/all.py", line 9, in <module>
from .totallyreal import enumerate_totallyreal_fields_prim
File "sage/rings/number_field/totallyreal_data.pxd", line 12, in init sage.rings.number_field.totallyreal (/opt/sage/sage-git/src/build/cythonized/sage/rings/number_field/totallyreal.c:12702)
File "sage/rings/number_field/totallyreal_data.pyx", line 41, in init sage.rings.number_field.totallyreal_data (/opt/sage/sage-git/src/build/cythonized/sage/rings/number_field/totallyreal_data.c:13440)
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 462, in PolynomialRing
R = _single_variate(base_ring, name, sparse, implementation)
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 540, in _single_variate
R = m.PolynomialRing_integral_domain(base_ring, name, sparse, implementation)
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 1603, in __init__
sparse=sparse, element_class=element_class, category=category)
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 1474, in __init__
sparse=sparse, element_class=element_class, category=category)
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_ring.py", line 290, in __init__
from sage.matrix.matrix_space import MatrixSpace
File "/opt/sage/sage-git/local/lib/python2.7/site-packages/sage/matrix/matrix_space.py", line 48, in <module>
from . import matrix_modn_sparse
File "sage/matrix/matrix_integer_dense.pxd", line 10, in init sage.matrix.matrix_modn_sparse (/opt/sage/sage-git/src/build/cythonized/sage/matrix/matrix_modn_sparse.c:15164)
File "sage/matrix/matrix_mod2_dense.pxd", line 4, in init sage.matrix.matrix_integer_dense (/opt/sage/sage-git/src/build/cythonized/sage/matrix/matrix_integer_dense.c:56343)
ImportError: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /opt/sage/sage-git/local/lib/libpng16.so.16)
This is because there is some kind of race condition: certain system libraries (OpenSSL for example) link against /lib64/libz.so.1 while Sage components link against the Sage-built libz.
In turns out that the first libz library which is loaded "wins": that one will be used by anything linking against libz. When starting IPython, the correct libz library is loaded because some IPython component uses libz. When running plain Python, this is not the case and the wrong libz is loaded. The easiest fix is to explicitly import libz when Sage starts up.
After the zlib upgrade, I cannot no longer run Sage under plain Python:
This is because there is some kind of race condition: certain system libraries (OpenSSL for example) link against
/lib64/libz.so.1while Sage components link against the Sage-built libz.In turns out that the first libz library which is loaded "wins": that one will be used by anything linking against
libz. When starting IPython, the correct libz library is loaded because some IPython component uses libz. When running plain Python, this is not the case and the wrong libz is loaded. The easiest fix is to explicitlyimport libzwhen Sage starts up.Component: build
Author: Jeroen Demeyer
Branch/Commit:
d59afe3Reviewer: Erik Bray
Issue created by migration from https://trac.sagemath.org/ticket/23122