ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 08 Oct 2019 01:09:18 +0200sage-8.9 fails compilation in Ubuntu 18.04https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/ Hello, Sage community!
I just downloaded the sage-8.9 source code. I tried to compile it with Python 3, but the process stops with an error when trying to install `matplotlib`. The problem seems to be related to the fact that the installer is looking for `libpng12`, which is no longer available at Ubuntu 18.04's repositories. I get the following error message:
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.16.1]
install_requires: yes [handled by setuptools]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 2.9.1]
png: no [The C/C++ header for libpng (png.h) could not
be found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'libqhull' could not
be found. Using local copy.]
[SOME EXTRA USELESS INFO HERE AND THEN...]
============================================================================
* The following required packages can not be built:
* png
* Try installing png with `apt-get install
* libpng12-dev` and pkg-config with `apt-get install
* pkg-config`
Is there something I can do in the meanwhile?
Thanks in advance!Tue, 01 Oct 2019 03:03:25 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/Answer by dsejas for <p>Hello, Sage community!</p>
<p>I just downloaded the sage-8.9 source code. I tried to compile it with Python 3, but the process stops with an error when trying to install <code>matplotlib</code>. The problem seems to be related to the fact that the installer is looking for <code>libpng12</code>, which is no longer available at Ubuntu 18.04's repositories. I get the following error message:</p>
<pre><code>REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.16.1]
install_requires: yes [handled by setuptools]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 2.9.1]
png: no [The C/C++ header for libpng (png.h) could not
be found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'libqhull' could not
be found. Using local copy.]
</code></pre>
<p>[SOME EXTRA USELESS INFO HERE AND THEN...]</p>
<pre><code> ============================================================================
* The following required packages can not be built:
* png
* Try installing png with `apt-get install
* libpng12-dev` and pkg-config with `apt-get install
* pkg-config`
</code></pre>
<p>Is there something I can do in the meanwhile?</p>
<p>Thanks in advance!</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?answer=48214#post-id-48214Hello, Sage community. I was able to solve this problem just by using `sudo apt-get install python`, which installs `python` and `python2` as synonyms. As of John Palmieri's comment, this seems to just install a prerequisite for the compilation. Unfortunately, I haven't been able to determine what this dependency is.Mon, 07 Oct 2019 04:22:55 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?answer=48214#post-id-48214Answer by John Palmieri for <p>Hello, Sage community!</p>
<p>I just downloaded the sage-8.9 source code. I tried to compile it with Python 3, but the process stops with an error when trying to install <code>matplotlib</code>. The problem seems to be related to the fact that the installer is looking for <code>libpng12</code>, which is no longer available at Ubuntu 18.04's repositories. I get the following error message:</p>
<pre><code>REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.16.1]
install_requires: yes [handled by setuptools]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 2.9.1]
png: no [The C/C++ header for libpng (png.h) could not
be found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'libqhull' could not
be found. Using local copy.]
</code></pre>
<p>[SOME EXTRA USELESS INFO HERE AND THEN...]</p>
<pre><code> ============================================================================
* The following required packages can not be built:
* png
* Try installing png with `apt-get install
* libpng12-dev` and pkg-config with `apt-get install
* pkg-config`
</code></pre>
<p>Is there something I can do in the meanwhile?</p>
<p>Thanks in advance!</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?answer=48113#post-id-48113Try `./sage -f libpng` (to force installation of Sage's version of `libpng`) and then `make`.Tue, 01 Oct 2019 05:39:28 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?answer=48113#post-id-48113Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48212#post-id-48212Hello, @JohnPalmieri. Just by accident, I found [this release announcement](https://groups.google.com/forum/#!topic/sage-release/kFVsdPJ1gmU/discussion) of Sage-8.9. It seems that they are having similar problems to which I had. I am not completely sure, because the text is too technical for me, but Samuel Lelievre's post (the second on the page I referenced) seems to be describing very similar problems to mine.
There seem to be no Ubuntu binaries for downloading as of today. i am wondering if this is due to the fact that builds are failing.Mon, 07 Oct 2019 04:11:45 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48212#post-id-48212Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48231#post-id-48231@desejas: Samuel Lelievre is discussing problems with ssl, but those are with OS X, and in particular a binary distribution of OS X. OS X has a weird setup regarding ssl. I don't think this is related to any ubuntu problems. Meanwhile, I haven't seen other reports of failures building on Ubuntu. I don't know why there aren't binaries yet.Tue, 08 Oct 2019 01:09:18 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48231#post-id-48231Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48114#post-id-48114One question: I was using the following flow of commands to compile:
make configure
./configure --with-python=3
make build
Does your suggestion fit in this process? Where in the previous process should I use the command you suggest?Tue, 01 Oct 2019 06:01:00 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48114#post-id-48114Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48118#post-id-48118After the build has failed, execute `./sage -f libpng` and then `make` (or `make build`, if you prefer).Tue, 01 Oct 2019 06:25:13 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48118#post-id-48118Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48126#post-id-48126Hello, @JohnPalmieri. I proceeded as you suggested, and I got stuck on the SciPy compilation. The problem seems to be that Openblas can't be found. I suppose that---extrapolating your suggestion---I can run `./sage -f openblas`. However, this makes me wonder why I have those problems even if I have both `libpng` and `openblas` installed on my system.Tue, 01 Oct 2019 21:25:28 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48126#post-id-48126Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48128#post-id-48128Maybe you need the `-dev` versions of these packages, e.g. `libopenblas-dev`. Maybe Sage's method of detecting whether a package needs to be installed needs some work: maybe it's detecting `openblas` but it should be looking for `libopenblas-dev`.Tue, 01 Oct 2019 23:06:47 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48128#post-id-48128Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48129#post-id-48129Actually, Sage should be installing its own version of `openblas` regardless, it seems to me. Maybe the system version is interfering, and this might be remedied by installing the `dev` version.Tue, 01 Oct 2019 23:17:47 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48129#post-id-48129Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48130#post-id-48130Hello, @JohnPalmieri. Sorry for keeping bothering you with this. Unfortunately, I have all those `-dev` libraries, but the problem persists.
To make things worse, I have finally completed the compilation, but my Sage seems to be broken. I cannot do `sage -pip install jupyterlab` because I get the message `pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.` I made `sage -f openssl`, `sage -f pip` and I have even installed `libssl-dev` and `openssl`, but nothing works.
I really need SageMath with Python3 working, so I have to keep trying!Tue, 01 Oct 2019 23:33:42 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48130#post-id-48130Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48131#post-id-48131By the way, a couple of weeks ago, I compiled Sage-8.8 with Python3 without any problem. Unfortunately, I had to format and reinstall my OS, but I have the same libraries as before.Tue, 01 Oct 2019 23:39:32 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48131#post-id-48131Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48132#post-id-48132To get `ssl` support, after doing `sage -f openssl`, you should also do `sage -f python3` to rebuild Python 3 with the `ssl` module. Then `sage -f pip` may or may not be necessary.Wed, 02 Oct 2019 01:15:55 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48132#post-id-48132Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48133#post-id-48133Hello, @JohnPalmieri. I want to thank you for taking the time to attend my case. I finally, solved it!!! I feel really stupid, though. I decided to make an experiment and download a SageMath binary compiled with Python 2. When I tried to run it, it complained about Python not being installed. That's when I realized that I didn't have Python 2 installed ("python" package in Ubuntu 18.04). After installing it and verifying the binary could run properly, I decided to try to compile Sage-8.9 with Python 3 again, from scratch, and it run smoothly. I didn't have to do anything else, nor take any additional step. It just compiled from start to end.
Should I post this (very shortly, though) as a solution? By the way, Python 2 is not listed as a dependency in the download folder's README.Wed, 02 Oct 2019 05:15:02 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48133#post-id-48133Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48134#post-id-48134I had assumed that building with Python 3 wouldn't need Python 2. Am I correct to understand from this incident that Sage-8.9 still compiles some packages with Python 2? The very low version of Matplotlib surprised me.
Thank you very much for your help!!!Wed, 02 Oct 2019 05:17:18 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48134#post-id-48134Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48135#post-id-48135Some of the installation scripts require a system Python to work. See the prerequisites section in http://doc.sagemath.org/html/en/installation/source.html. Whether it's Python 2 or 3, I think there has to be something called "python", or maybe it's okay just to have "python3". I didn't know that binary distributions also require it.Wed, 02 Oct 2019 06:04:28 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48135#post-id-48135Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48136#post-id-48136So did you have neither Python 2 nor Python 3 installed when trying to build Sage? If you had Python 3 but not Python 2, that may be a bug.Wed, 02 Oct 2019 06:05:46 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48136#post-id-48136Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48138#post-id-48138When the compilation failed, I had Python 3 installed, but not Python 2. For 3, the interpreter/compiler is called `python3` in Ubuntu, while `python` is equivalent to `python2`. (I suppose `python` will become equivalent to `python3` once 2 is abandoned.)
I am not completely sure this is a bug of Sage. For example, during the compilation, the library `Matplotlib` 1.1.2 is installed. That is a very old version (current version is 3.1.1), and it worked with Python 2 only, as far as I know, while, On the contrary, Matplotlib 3.1.1 is Python 3 compatible only. Also, we have to consider that Sage has very old dependencies (abandonware?), like `Tachyon`.
So, maybe this is a problem of some packages being aged, like `Tachyon`, and others not being used with the modern version.Wed, 02 Oct 2019 06:53:04 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48138#post-id-48138Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48149#post-id-48149As an experiment, I removed the `python2` package from my Ubuntu virtual machine, keeping `python3`, and a Python 3 build of Sage went fine. `sage --pip install ...` works, too. So maybe when you installed the `python` package, it installed some other key piece that made the installation work.Wed, 02 Oct 2019 20:40:00 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48149#post-id-48149Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48150#post-id-48150By the way, Sage 8.9 should install version 2.2.4 of `matplotlib`, not version 1.1.2.Wed, 02 Oct 2019 20:40:57 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48150#post-id-48150Comment by dsejas for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48158#post-id-48158Yes, Matplotlib 2.2.4 is installed. Sorry about the confusion. The experiment you made is very interesting. However, makes me wonder, did you uninstalled `python2.7` or `python`? Both packages are present in my OS. Also, remember that you should uninstall `python2.7-minimal`, also. Of course, this is assuming you have version 2.7 installed.Thu, 03 Oct 2019 04:47:19 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48158#post-id-48158Comment by John Palmieri for <p>Try <code>./sage -f libpng</code> (to force installation of Sage's version of <code>libpng</code>) and then <code>make</code>.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48159#post-id-48159I don't remember which ones I uninstalled, but afterwards, the command `python` was not found, while `python3` was.Thu, 03 Oct 2019 05:04:06 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48159#post-id-48159Answer by eric_g for <p>Hello, Sage community!</p>
<p>I just downloaded the sage-8.9 source code. I tried to compile it with Python 3, but the process stops with an error when trying to install <code>matplotlib</code>. The problem seems to be related to the fact that the installer is looking for <code>libpng12</code>, which is no longer available at Ubuntu 18.04's repositories. I get the following error message:</p>
<pre><code>REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.16.1]
install_requires: yes [handled by setuptools]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 2.9.1]
png: no [The C/C++ header for libpng (png.h) could not
be found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'libqhull' could not
be found. Using local copy.]
</code></pre>
<p>[SOME EXTRA USELESS INFO HERE AND THEN...]</p>
<pre><code> ============================================================================
* The following required packages can not be built:
* png
* Try installing png with `apt-get install
* libpng12-dev` and pkg-config with `apt-get install
* pkg-config`
</code></pre>
<p>Is there something I can do in the meanwhile?</p>
<p>Thanks in advance!</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?answer=48119#post-id-48119On Ubuntu 18.04, you should install the Ubuntu package `libpng16-16` prior to SageMath installation.Tue, 01 Oct 2019 07:59:41 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?answer=48119#post-id-48119Comment by eric_g for <p>On Ubuntu 18.04, you should install the Ubuntu package <code>libpng16-16</code> prior to SageMath installation.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48181#post-id-48181I've just compiled successfully Sage 8.9 (Python 3 version) from scratch on a Ubuntu 18.04 computer. The only png-related package installed on that computer is `libpng16-16` (in particular, `libpng-dev` is not installed). So I am puzzled by your issue. If this might be helpful, here are the steps of what I've done:
git clone https://github.com/sagemath/sage.git
cd sage
make configure
./configure --with-python=3
MAKE="make -j16" makeFri, 04 Oct 2019 17:34:09 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48181#post-id-48181Comment by dsejas for <p>On Ubuntu 18.04, you should install the Ubuntu package <code>libpng16-16</code> prior to SageMath installation.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48213#post-id-48213Hello, @eric_g! Do you, by any chance, happened to have installed `python` and/or `python2` before making `make`? I could solve my problem by installing those two packages previous to the compilation.Mon, 07 Oct 2019 04:13:41 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48213#post-id-48213Comment by eric_g for <p>On Ubuntu 18.04, you should install the Ubuntu package <code>libpng16-16</code> prior to SageMath installation.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48217#post-id-48217@dsejas Yes indeed the Ubuntu package `python` was installed on my computer prior to Sage build.Mon, 07 Oct 2019 10:24:56 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48217#post-id-48217Comment by dsejas for <p>On Ubuntu 18.04, you should install the Ubuntu package <code>libpng16-16</code> prior to SageMath installation.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48125#post-id-48125Hello, @eric_g. Forseeing the compilation of SageMath, I already had installed `libpng16-16`. Even so, the compilation fails.Tue, 01 Oct 2019 21:21:15 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48125#post-id-48125Comment by John Palmieri for <p>On Ubuntu 18.04, you should install the Ubuntu package <code>libpng16-16</code> prior to SageMath installation.</p>
https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48127#post-id-48127Maybe install `libpng-dev` in addition? That should contain the header file `png.h` which matplotlib is complaining about.Tue, 01 Oct 2019 23:05:03 +0200https://ask.sagemath.org/question/48112/sage-89-fails-compilation-in-ubuntu-1804/?comment=48127#post-id-48127