python pandas import 失败

时间:2023-03-10 05:26:46
python pandas import 失败

今天因为数据处理的需要,安装了pandas。

我的python版本是2.7,使用的编辑器是pycharm。我现在cmd中输入了pip install pandas,然后显示安装成功,但是在使用pandas.read_pickle()时报错了。

以下是我的错误:

ImportError: C extension:numpy.core.utils not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.

解决方案:

看了一下错误,是numpy的问题。因为numpy是之前装的,已经忘记了它的相关配置,为了保险起见,我就卸载了pandas和numpy,然后在pycharm-file-setting-project intepreters-+中重新安装了numpy和pandas,这样再

重新运行,问题就解决了。