如何解决pandas的导入错误?

我用python 2.7.7安装了Anaconda.但是,每当我运行“import pandas”时,我都会收到错误:“ImportError:C extension:y not built.如果你想从源目录导入pandas,你可能需要运行’python setup.py build_ext –inplace’首先构建C扩展.“我尝试运行建议的命令,但它说明了

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)

有没有人遇到过此之前找到了解决方案?

解决方法:

Pandas的部分代码用C语言编写,以使其运行得更快.如果您尝试手动安装pandas,则需要构建它.尝试使用miniconda包管理器重新安装它:http://conda.pydata.org/miniconda.html

然后你就可以做到

conda install pandas

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

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

上一篇:Python3函数注释,用于类型提示与Boo


下一篇:python – 如何使PyDev autoformat成为每行的最大字符数?