我使用以下命令来了解我正在使用的numpy版本
pip show numpy
输出如下所示
--- Name: numpy Version: 1.8.2 Location: /usr/lib/python2.7/dist-packages Requires:
但是,当我运行matplotlib时,我收到了一个错误
RuntimeError: module compiled against API version a but this version of numpy is 9 from matplotlib import pyplot as plt File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 27, inimport matplotlib.colorbar File "/usr/local/lib/python2.7/dist-packages/matplotlib/colorbar.py", line 32, in import matplotlib.artist as martist File "/usr/local/lib/python2.7/dist-packages/matplotlib/artist.py", line 12, in from .transforms import Bbox, IdentityTransform, TransformedBbox, \ File "/usr/local/lib/python2.7/dist-packages/matplotlib/transforms.py", line 39, in from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
我试着升级numpy,
pip install numpy --upgrade
它显示安装成功,但numpy仍然显示为1.8.2并且在运行matplotlib时仍然存在错误.
我想卸载numpy并重新安装它,系统给出了消息说
Not uninstalling numpy at /usr/lib/python2.7/dist-packages, owned by OS
怎么解决?任何想法
RuntimeError:针对API版本a编译的模块,但此版本的numpy为9
小智.. 12
我如何升级numpy?可能会为你工作.在那种情况下,这是一个路径问题:
RuntimeError: module compiled against API version 9 but this version of numpy is 6 Traceback (most recent call last): File "", line 1, in ImportError: numpy.core.multiarray failed to import
解:
检查路径
import numpy print numpy.__path__
并使用rm手动删除它
我如何升级numpy?可能会为你工作.在那种情况下,这是一个路径问题:
RuntimeError: module compiled against API version 9 but this version of numpy is 6 Traceback (most recent call last): File "", line 1, in ImportError: numpy.core.multiarray failed to import
解:
检查路径
import numpy print numpy.__path__
并使用rm手动删除它