一尘不染

如何解决pandas进口错误?

python

我用python 2.7.7安装了Anaconda。
但是,每当我运行“ import pandas”时,都会出现错误:
"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."
我尝试运行建议的命令,但它指出

skipping 'pandas\index.c' Cython extension (up-to-date)      
skipping 'pandas\src\period.c' Cython extension (up-to-date) 
skipping 'pandas\algos.c' Cython extension (up-to-date)      
skipping 'pandas\lib.c' Cython extension (up-to-date)        
skipping 'pandas\tslib.c' Cython extension (up-to-date)      
skipping 'pandas\parser.c' Cython extension (up-to-date)     
skipping 'pandas\hashtable.c' Cython extension (up-to-date)  
skipping 'pandas\src\sparse.c' Cython extension (up-to-date) 
skipping 'pandas\src\testing.c' Cython extension (up-to-date)
skipping 'pandas\msgpack.cpp' Cython extension (up-to-date)

有人遇到过这个问题并找到了解决方案吗?


阅读 256

收藏
2020-12-20

共1个答案

一尘不染

Pandas使用C语言编写了部分代码,以使其运行更快。如果尝试手动安装熊猫,则需要对其进行构建。尝试在此处使用miniconda软件包管理器重新安装它:http
://conda.pydata.org/miniconda.html

然后你可以做

conda install pandas

下面的链接中有关于如何执行操作的非常简单的说明。只要执行ctrl -f miniconda来找到谈论它的部分

http://pandas.pydata.org/pandas-
docs/dev/install.html

2020-12-20