因为在用的matplotlib版本太低,想升级一下,升级完发现原来可以跑通的程序报错了,于是又升级了pandas和numpy,但是还是报错your numpy version is 1.8.0rc1. Please upgrade numpy to >= 1.9.0 to use this pandas version
但是明明升级成功了呀
python -m pip install -U numpy==1.14.3
Requirement already satisfied: numpy==1.14.3 in /Library/Python/2.7/site-packages (1.14.3)
然后参考了这篇stackoverflow上的答案解决了问题
>>> import numpy
>>> numpy.__version__
'1.8.0rc1'
>>> print (numpy)
<module 'numpy' from '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc'>
$ cd /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/
$ sudo rm -r numpy
>>> import numpy
>>> numpy.__version__
'1.14.3'
>>> print (numpy)
<module 'numpy' from '/Library/Python/2.7/site-packages/numpy/__init__.pyc'>
原来是装了两个,路径不同,优先取了系统路径下的numpy,把1.8.0rc1的删掉,另一个就可以用了