conda install with matplotlib

503 views
Skip to first unread message

Martin Genet

unread,
Dec 16, 2017, 2:38:11 AM12/16/17
to fenics-...@googlegroups.com
Dear all:

After installing FEniCS through conda (conda create -n fenics -c
conda-forge fenics) on Linux (KUbuntu 14.04), and adding matplotlib to
the conda fenics environment (conda install -n fenics matplotlib), I am
getting the following error when importing matplotlib:

> > source activate fenics
>
> > python -c "import matplotlib.pyplot"
>
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/pyplot.py",
> line 32, in <module>
>     import matplotlib.colorbar
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/colorbar.py",
> line 32, in <module>
>     import matplotlib.artist as martist
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/artist.py",
> line 16, in <module>
>     from .path import Path
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/path.py",
> line 25, in <module>
>     from . import _path, rcParams
> ImportError:
> /home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/../../../libstdc++.so.6:
> version `CXXABI_1.3.9' not found (required by
> /home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/_path.so)

However if I create another environment with matplotlib only (conda
create -n matplotlib matplotlib), then it works fine. I am new to this
conda thing (which looks awesome by the way, like hashdist but without
compilation burden), so I could use some help, if anyone has any
suggestion. Thanks in advance.

Martin

Martin Genet

unread,
Dec 16, 2017, 5:25:18 AM12/16/17
to Praveen C, fenics-...@googlegroups.com
Thanks Praveen!

For some reason conda downgraded fenics when installing matplotlib from
conda-forge:

> > conda install -n fenics -c conda-forge matplotlib
> Fetching package metadata .............
> Solving package specifications: .
>
> Package plan for installation in environment
> /home/genet/.conda/envs/fenics:
>
> The following packages will be UPDATED:
>
>     matplotlib: 2.1.1-py27h0128e01_0              -->
> 2.1.1-py27_1                  conda-forge
>     petsc:      3.7.6-blas_openblas_0 conda-forge [blas_openblas] -->
> 3.8.1-blas_openblas_0         conda-forge [blas_openblas]
>     petsc4py:   3.7.0-py27_1          conda-forge -->
> 3.8.1-py27_1                  conda-forge
>     slepc:      3.7.4-0               conda-forge -->
> 3.8.0-blas_openblas_0         conda-forge [blas_openblas]
>     slepc4py:   3.7.0-py27_0          conda-forge -->
> 3.8.0-py27_0                  conda-forge
>
> The following packages will be SUPERSEDED by a higher-priority channel:
>
>     scipy:      1.0.0-py27hf5f0f52_0              -->
> 0.19.1-py27_blas_openblas_202 conda-forge [blas_openblas]
>
> The following packages will be DOWNGRADED:
>
>     fenics:     2017.1.0-np113py27_6  conda-forge -->
> 2016.1.0-py27_1               conda-forge

And then importing matplotlib from fenics environment failed again, same
error, but different path:

> > python -c "import matplotlib.pyplot"
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/pyplot.py",
> line 116, in <module>
>     _backend_mod, new_figure_manager, draw_if_interactive, _show =
> pylab_setup()
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/backends/__init__.py",
> line 60, in pylab_setup
>     [backend_name], 0)
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py",
> line 16, in <module>
>     from .backend_qt5 import (
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py",
> line 18, in <module>
>     import matplotlib.backends.qt_editor.figureoptions as figureoptions
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/backends/qt_editor/figureoptions.py",
> line 20, in <module>
>     import matplotlib.backends.qt_editor.formlayout as formlayout
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/backends/qt_editor/formlayout.py",
> line 56, in <module>
>     from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
>   File
> "/home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/backends/qt_compat.py",
> line 137, in <module>
>     from PyQt5 import QtCore, QtGui, QtWidgets
> ImportError:
> /home/genet/.conda/envs/fenics/lib/python2.7/site-packages/matplotlib/../../../libstdc++.so.6:
> version `CXXABI_1.3.9' not found (required by
> /home/genet/.conda/envs/fenics/lib/python2.7/site-packages/PyQt5/QtCore.so)
Weird…

Anyway, thanks again.

Martin

On 16/12/2017 10:34, Praveen C wrote:
> Did you try
>
> conda install -n fenics -c conda-forge matplotlib
>
> Best
> praveen
>> --
>> You received this message because you are subscribed to the Google Groups "fenics-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to fenics-suppor...@googlegroups.com.
>> To post to this group, send email to fenics-...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/fenics-support/63dbdeec-97a3-68a5-7726-4f25da90fb8a%40polytechnique.edu.
>> For more options, visit https://groups.google.com/d/optout.

Praveen C

unread,
Dec 20, 2017, 4:11:45 AM12/20/17
to Martin Genet, fenics-...@googlegroups.com
Did you try

conda install -n fenics -c conda-forge matplotlib

Best
praveen

> On 16-Dec-2017, at 1:08 PM, Martin Genet <martin...@polytechnique.edu> wrote:
>

Jack Hale

unread,
Dec 20, 2017, 5:19:39 AM12/20/17
to Praveen C, Martin Genet, fenics-...@googlegroups.com
On Azure Notebooks the other day it was necessary to use the following in a python 3.5-based notebook:

!conda config --add channels conda-forge

!conda install -y fenics matplotlib "icu=58.*" "cmake=3.9"



Reply all
Reply to author
Forward
0 new messages