Python Pip&;API版本

Python Pip&;API版本,python,homebrew,Python,Homebrew,我有一个(以前的)工作脚本,我无法运行,因为numpy API版本之间存在一些冲突。。。我检查了API 9的sudopip install numpy==1.8——升级,但仍然得到下面的错误。你知道怎么解决这个问题吗 /Library/Python/2.7/site-packages/pytz/__init__.py:29: UserWarning: Module numpy was already imported from /System/Library/Frameworks/Pytho

我有一个(以前的)工作脚本,我无法运行,因为numpy API版本之间存在一些冲突。。。我检查了API 9的
sudopip install numpy==1.8——升级
,但仍然得到下面的错误。你知道怎么解决这个问题吗

/Library/Python/2.7/site-packages/pytz/__init__.py:29: 
UserWarning: Module numpy was already imported from 
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.py,
but /Library/Python/2.7/site-packages is being added to sys.path

from pkg_resources import resource_stream
RuntimeError: module compiled against API version 9 but this version of numpy is 6
RuntimeError: module compiled against API version 9 but this version of numpy is 6
Traceback (most recent call last):
File "Hyperbola_search.py", line 12, in <module>
import matplotlib.pyplot as plt
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/pyplot.py", line 27, in <module>
import matplotlib.colorbar
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/colorbar.py", line 34, in <module>
import matplotlib.collections as collections
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/collections.py", line 27, in <module>
import matplotlib.backend_bases as backend_bases
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/backend_bases.py", line 56, in <module>
import matplotlib.textpath as textpath
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/textpath.py", line 19, in <module>
import matplotlib.font_manager as font_manager
File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/font_manager.py", line 57, in <module>
from matplotlib import ft2font
ImportError: numpy.core.multiarray failed to import`
/Library/Python/2.7/site-packages/pytz/__-init.py:29:
UserWarning:模块numpy已从导入
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/Python/numpy/___init__.py,
但是/Library/Python/2.7/site-packages被添加到sys.path中
从pkg_资源导入资源_流
RuntimeError:根据API版本9编译模块,但此版本的numpy为6
RuntimeError:根据API版本9编译模块,但此版本的numpy为6
回溯(最近一次呼叫最后一次):
文件“双曲线搜索.py”,第12行,在
将matplotlib.pyplot作为plt导入
文件“/Library/Python/2.7/site packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/pyplot.py”,中第27行
导入matplotlib.colorbar
文件“/Library/Python/2.7/site packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/colorbar.py”,第34行,中
将matplotlib.collections导入为集合
文件“/Library/Python/2.7/site packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/collections.py”,第27行,在
导入matplotlib.backend_base作为后端_base
文件“/Library/Python/2.7/site packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/backend_base.py”,第56行,在
将matplotlib.textpath导入为textpath
文件“/Library/Python/2.7/site packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/textpath.py”,中第19行
将matplotlib.font\u管理器导入为font\u管理器
文件“/Library/Python/2.7/site packages/matplotlib-1.4.x-py2.7-macosx-10.9-intel.egg/matplotlib/font_manager.py”,第57行,在
从matplotlib导入ft2font
ImportError:numpy.core.multiarray导入失败`

我在导入numpy之前添加了
sys.path.reverse()
,这似乎解决了问题。有没有更明确的解决方案?