我不得不重新安装anaconda和Jupyter现在我无法在Jupyter笔记本中导入pandas。它表示将numpy升级到1.7.0。做到了这一点,但问题仍然存在
这是错误:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-af55e7023913> in <module>()
----> 1 import pandas as pd
/Library/Python/2.7/site-packages/pandas/__init__.py in <module>()
21
22 # numpy compat
---> 23 from pandas.compat.numpy import *
24
25 try:
/Library/Python/2.7/site-packages/pandas/compat/numpy/__init__.py in <module>()
22 'your numpy version is {0}.\n'
23 'Please upgrade numpy to >= 1.7.0 to use '
---> 24 'this pandas version'.format(_np_version))
25
26
ImportError: this version of pandas is incompatible with numpy < 1.7.0
your numpy version is 1.6.2.
Please upgrade numpy to >= 1.7.0 to use this pandas version
答案 0 :(得分:0)
看起来您没有正确设置路径。您没有链接到anaconda发行版。确保您的.bash_profile
文件设置正确 - 假设您使用的是bash shell。如果没有,请在.bash_profile
中添加此行:
# added by Anaconda3 4.3.0 installer
# need to change path to Anaconda directory if not in your home directory
# this is setup for Python3.6 in my home directory
export PATH="/Users/home_dir/anaconda3/bin:$PATH"```