You are not logged in.

#1 2019-06-08 06:26:01

darenw
Member
From: Trego Montana
Registered: 2008-07-04
Posts: 112
Website

Python 3.7.3 Matplotlib.PyPlot not loading

Not so long ago, I was using Python, Numpy, and Matplotlib just fine.  There was about a month I didn't use Python non-trivially, then a few days ago tried plotting some data with Matplotlib.  I can import just matplotlib by itself.  Usually I import  pyplot, but that fails. Doesn't matter if I have "as blahblah" or not.   

Solutions easily found on the web are to re-install or upgrade using your linux package manager, or using pip  as in:
pip install --upgrade numpy
but none of that changes things for me.  I did a whole system upgrade this morning, pacman -Syu.     Problem is only in Python3. Python2 works okay. 

Ideas for further diagnostics?  Is there a known version incompatibility involved?  Only thing different between a month ago and the recent trouble is that I installed Ogre3D and some other 3D engine related stuff, and Gazebo the robotics simulator. 

darenw-arsenic  (master) 0=> python3
Python 3.7.3 (default, Mar 26 2019, 21:43:19)
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import matplotlib as xxx
>>> import matplotlib.pyplot
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/matplotlib/pyplot.py", line 32, in <module>
    import matplotlib.colorbar
  File "/usr/lib/python3.7/site-packages/matplotlib/colorbar.py", line 27, in <module>
    import matplotlib.artist as martist
  File "/usr/lib/python3.7/site-packages/matplotlib/artist.py", line 13, in <module>
    from .path import Path
  File "/usr/lib/python3.7/site-packages/matplotlib/path.py", line 17, in <module>
    from . import _path, cbook, rcParams
ImportError: numpy.core.multiarray failed to import
>>> exit()

darenw-arsenic  (master) 0=> python2
Python 2.7.16 (default, Mar 11 2019, 18:59:25)
[GCC 8.2.1 20181127] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import matplotlib.pyplot
>>>

darenw-arsenic  (master) 0=>


Artist/Physicist, Herder of Pixels, Photons and Electrons

Offline

#2 2019-06-08 06:38:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Python 3.7.3 Matplotlib.PyPlot not loading

Please use code tages when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code

And read the note about using --user if you use pip so as not to conflict with system packages: https://wiki.archlinux.org/index.php/Py … management


Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-06-08 12:51:56

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,515

Re: Python 3.7.3 Matplotlib.PyPlot not loading

$ python
Python 3.7.3 (default, Mar 26 2019, 21:43:19) 
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import matplotlib as xxx
>>> import matplotlib.pyplot
>>> 

I don't have any python2 stuff installed.
Lately i've seen a few cases where scripts / programs (cmake is one of them) default to python2 if both python2 and python3 are present.

A quick test could be to remove python2-numpy & python2-matplotlib , then try again.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB