我正在学习使用 pandas 的 Python 教程,但遇到了一个我无法弄清楚的依赖性问题。
为了安装 pandas,我运行了:
pip install pandas
但是当我打开一个 python session 并尝试导入 pandas 时,我收到一条错误消息,提示“缺少必需的依赖项 ('numpy')”,尽管我在运行 pip 命令安装 pandas 时看到它已安装。
帮助将不胜感激。谢谢。
编辑:下面发布了完整的错误消息:
PS C:\Python> python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\user1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pandas\__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
请您参考如下方法:
尝试安装 Anaconda 3(它可以在 Windows 和 Linux 上运行),它包含所有有用的库,如 panda、numpy...所以你不必自己下载或重建
