Opened 9 years ago
Closed 9 years ago
#50065 closed defect (invalid)
py-matplotlib: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9
Reported by: | phillicl@… | Owned by: | seanfarley (Sean Farley) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.4 |
Keywords: | Cc: | ||
Port: | py-matplotlib |
Description
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
Change History (6)
comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)
Owner: | changed from macports-tickets@… to sean@… |
---|---|
Port: | py-matplotlib added |
Summary: | Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 → py-matplotlib: Problem with import matplotlib.pyplot : RuntimeError: module compiled against API version a but this version of numpy is 9 |
comment:2 Changed 9 years ago by phillicl@…
comment:3 Changed 9 years ago by seanfarley (Sean Farley)
Did you install any python packages in your system python? Or anything in /usr/local
?
comment:4 Changed 9 years ago 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.)
comment:5 Changed 9 years ago 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
comment:6 Changed 9 years ago by seanfarley (Sean Farley)
Resolution: | → invalid |
---|---|
Status: | new → closed |
Yep. You can't use pip outside of a virtualenv with any package manager, really.
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.
Indeed now I get which python /opt/local/bin/python
import numpy
'1.10.1'
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