[MacPorts] #50065: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9
#50065: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 ------------------------+-------------------------------- Reporter: phillicl@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: ------------------------+-------------------------------- Somehow the matplotlib port has been compiled against the wrong version of numpy. (This problem started after I did port install py27-pandas ) {{{ import matplotlib.pyplot }}} generates the error {{{ RuntimeError: module compiled against API version a but this version of numpy is 9 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/pyplot.py", line 29, in <module> import matplotlib.colorbar File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/colorbar.py", line 32, in <module> import matplotlib.artist as martist File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/artist.py", line 14, in <module> from .transforms import (Bbox, IdentityTransform, TransformedBbox, File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/transforms.py", line 39, in <module> from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox, ImportError: numpy.core.multiarray failed to import }}} Some attempts to reinstall matplotlib, numpy, and scipy have not resolved the problem -- Ticket URL: <https://trac.macports.org/ticket/50065> MacPorts <https://www.macports.org/> Ports system for OS X
#50065: py-matplotlib: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 ----------------------------+-------------------- Reporter: phillicl@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: py-matplotlib | ----------------------------+-------------------- Changes (by ryandesign@…): * owner: macports-tickets@… => sean@… * port: => py-matplotlib -- Ticket URL: <https://trac.macports.org/ticket/50065#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#50065: py-matplotlib: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 ----------------------------+-------------------- Reporter: phillicl@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: py-matplotlib | ----------------------------+-------------------- Comment (by phillicl@…): I decided that the problem may be that despite the fact that I uninstalled and reinstalled numpy, that an old version of numpy (1.9.3) was still hanging around and being imported each time numpy was used. So I uninstalled py27-numpy, cleaned that directory, and rebuilt everything. Indeed now I get which python /opt/local/bin/python import numpy
numpy.__version__ '1.10.1' numpy.__path__ ['/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/numpy']
However, now when I import matplotb.pyplot, the import just hangs..... When I kill the import, its always hanging in the same place {{{ File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/pyplot.py", line 29, in <module> import matplotlib.colorbar File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/colorbar.py", line 34, in <module> import matplotlib.collections as collections File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/collections.py", line 27, in <module> import matplotlib.backend_bases as backend_bases File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/backend_bases.py", line 62, in <module> import matplotlib.textpath as textpath File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/textpath.py", line 15, in <module> import matplotlib.font_manager as font_manager File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/font_manager.py", line 1420, in <module> _rebuild() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/font_manager.py", line 1405, in _rebuild fontManager = FontManager() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/font_manager.py", line 1043, in __init__ self.ttffiles = findSystemFonts(paths) + findSystemFonts() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/font_manager.py", line 323, in findSystemFonts for f in get_fontconfig_fonts(fontext): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 /site-packages/matplotlib/font_manager.py", line 276, in get_fontconfig_fonts output = pipe.communicate()[0] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 799, in communicate return self._communicate(input) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1409, in _communicate stdout, stderr = self._communicate_with_poll(input) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1463, in _communicate_with_poll ready = poller.poll() }}} -- Ticket URL: <https://trac.macports.org/ticket/50065#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#50065: py-matplotlib: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 ----------------------------+-------------------- Reporter: phillicl@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: py-matplotlib | ----------------------------+-------------------- Comment (by sean@…): Did you install any python packages in your system python? Or anything in `/usr/local`? -- Ticket URL: <https://trac.macports.org/ticket/50065#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#50065: py-matplotlib: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 ----------------------------+-------------------- Reporter: phillicl@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: py-matplotlib | ----------------------------+-------------------- Comment (by phillicl@…): I always use the macport python. However, I think I used pip install to install tensorflow. Perhaps that initiated the depedency problem where the path to my system's numpy package because the first found. (I read that the first time matplotlib.pyplot is called, it may just need to run for a while. I let it do this and the problem resolved.) -- Ticket URL: <https://trac.macports.org/ticket/50065#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#50065: py-matplotlib: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 ----------------------------+-------------------- Reporter: phillicl@… | Owner: sean@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: py-matplotlib | ----------------------------+-------------------- Comment (by phillicl@…): From their website Pip install: Install TensorFlow on your machine, possibly upgrading previously installed Python packages. May impact existing Python programs on your machine. So... that is probably what happened -- Ticket URL: <https://trac.macports.org/ticket/50065#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#50065: py-matplotlib: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 ----------------------------+-------------------- Reporter: phillicl@… | Owner: sean@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: invalid | Keywords: Port: py-matplotlib | ----------------------------+-------------------- Changes (by sean@…): * status: new => closed * resolution: => invalid Comment: Yep. You can't use pip outside of a virtualenv with any package manager, really. -- Ticket URL: <https://trac.macports.org/ticket/50065#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts