in my system, matplotlib works fine with python 3.6, but fails with python 3.7: Python 3.7.5 (default, Nov 11 2019, 22:01:35) [GCC 9.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.7/site-packages/matplotlib/pyplot.py", line 31, in <module> import matplotlib.colorbar File "/usr/lib/python3.7/site-packages/matplotlib/colorbar.py", line 32, in <module> import matplotlib.artist as martist File "/usr/lib/python3.7/site-packages/matplotlib/artist.py", line 16, in <module> from .path import Path File "/usr/lib/python3.7/site-packages/matplotlib/path.py", line 21, in <module> from . import _path, rcParams ImportError: /usr/lib/python3.7/site-packages/matplotlib/_path.cpython-37m-x86_64-linux-gnu.so: undefined symbol: MPL_matplotlib_backends__backend_agg_ARRAY_API >>> Reproducible: Always
It did not happen before. But recently I had some dependecy issues, I rebuilt some packages, matplotlib included. And I had exactly the same error with python 3.7.6. Building matplotlib with MAKEOPTS="-j1 -l0" produces working library.
Fixed by dev-python/matplotlib-2.2.4-r100 from my overlay: https://github.com/stefantalpalaru/gentoo-overlay It boils down to "py_converters.o" being shared by different extensions while needing a different "-DPY_ARRAY_UNIQUE_SYMBOL=..." value for each of them. Fixing it for Python3 was trivial - just disable parallel building, as already mentioned here. The Python2 fix was anything but trivial, after hunting a bunch of ridiculous monkey-patching between distutils, setuptools, Cython's own distutils variant (if installed) and matplotlib's own setup.py. That object file was compiled only once, then linked in 4 different extensions. The solution was even more overriding in order to delete all object files between extension builds. Language-specific build systems are an abomination...
Now we have matplotlib-3.1.2 in tree, can this bug be reproduced?
(In reply to Benda Xu from comment #3) > Now we have matplotlib-3.1.2 in tree, can this bug be reproduced? There are situations where this kind of argument is totally unproductive. For example, if I want to install Sage (from the sage-on-gentoo overlay), I am restricted by a '<dev-python/matplotlib-3' constraint. Then having a 3.x version does not help me - I must go past the errors of the 2.x branch. Just because there is a new version does not imply that all packages that rely on this one will upgrade to it immediately - it may take even years. Please concentrate on productive arguments.
In other distributions they allow sage to be compiled with newer matplotlib-3 with patches like: https://git.archlinux.org/svntogit/community.git/tree/trunk/sagemath-matplotlib-3.2.patch?h=packages/sagemath I have also seen similar in Debian and Fedora... maybe you could report to the author of the overlay :/
Yes, sage-9.0 is a bit of a pickle and I intend to retire it the minute 9.1 is out. Technically I could backport a number of fixes to move to newer matplotlib/sphinx and what not. But I almost would prefer people to just go for sage-9999 which is technically 9.1rc2 at the time of writing. May be that's what I should do. Create a 9.1.rc2 ebuild so people don't feel they are on the edge and have something productive which doesn't drag python2 compatibility kludge.
Hello François, nice to see you here. Yes, you are right, me too is just waiting for the 9.1 release and I am reluctant to use something with a '9999' tag on it. It's just human psychology, you know - we don't trust the unfamiliar. '9.1-preRC125.2.1b' is so much more reassuring than the hackish/binary/hex-looking version '9999'. :-)
Well, the default sage version in the overlay is now 9.1_rc2. I'll remove 9.0 and all its crumbs in a couple of days. Use the usual channels to report issues with the release. At least, I am not holding anyone onto matplotlib-2 anymore.
I can confirm the problem and I could install it with this command sudo MAKEOPTS="-j1" emerge --oneshot --ask --ignore-default-opts --jobs=1 matplotlib It is a similar problem than: https://bugs.gentoo.org/676640
*** Bug 721644 has been marked as a duplicate of this bug. ***
This bug should be set as confirmed…
I am experiencing this too when launching pitivi. dev-python/matplotlib-2.2.2-r1 media-video/pitivi-0.999-r3 ❯ pitivi Traceback (most recent call last): File "/usr/bin/pitivi", line 168, in <module> _run_pitivi() File "/usr/bin/pitivi", line 145, in _run_pitivi from pitivi import application File "/usr/lib64/pitivi/python/pitivi/application.py", line 34, in <module> from pitivi.mainwindow import MainWindow File "/usr/lib64/pitivi/python/pitivi/mainwindow.py", line 47, in <module> from pitivi.timeline.timeline import TimelineContainer File "/usr/lib64/pitivi/python/pitivi/timeline/timeline.py", line 35, in <module> from pitivi.timeline.elements import Clip File "/usr/lib64/pitivi/python/pitivi/timeline/elements.py", line 31, in <module> from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas File "/usr/lib/python3.7/site-packages/matplotlib/backends/backend_gtk3cairo.py", line 6, in <module> from . import backend_cairo, backend_gtk3 File "/usr/lib/python3.7/site-packages/matplotlib/backends/backend_cairo.py", line 41, in <module> from matplotlib.backend_bases import ( File "/usr/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 53, in <module> from matplotlib import ( File "/usr/lib/python3.7/site-packages/matplotlib/textpath.py", line 15, in <module> from matplotlib.path import Path File "/usr/lib/python3.7/site-packages/matplotlib/path.py", line 21, in <module> from . import _path, rcParams ImportError: /usr/lib/python3.7/site-packages/matplotlib/_path.cpython-37m-x86_64-linux-gnu.so: undefined symbol: MPL_matplotlib_backends__backend_agg_ARRAY_API
I am also experiencing this with matplotlib-2.2.-r1 and python 3.7.7. When I try to run a script that imports matplotlib, I get this error: Traceback (most recent call last): File "./twobat_plot.py", line 7, in <module> import matplotlib.pyplot as plt File "/usr/lib/python3.7/site-packages/matplotlib/pyplot.py", line 31, in <module> import matplotlib.colorbar File "/usr/lib/python3.7/site-packages/matplotlib/colorbar.py", line 32, in <module> import matplotlib.artist as martist File "/usr/lib/python3.7/site-packages/matplotlib/artist.py", line 16, in <module> from .path import Path File "/usr/lib/python3.7/site-packages/matplotlib/path.py", line 21, in <module> from . import _path, rcParams ImportError: /usr/lib/python3.7/site-packages/matplotlib/_path.cpython-37m-x86_64-linux-gnu.so: undefined symbol: MPL_matplotlib_backends__backend_agg_ARRAY_API
I am also experiencing the same issue with matplotlib-2.2.-r1 and python 3.7.7 like many of you and the workaround is working for me is that comment #9 sudo MAKEOPTS="-j1" emerge --oneshot --ask --ignore-default-opts --jobs=1 matplotlib