I installed Anaconda with python 2.7.7.
However, whenever I run "import pandas" I get the error:
"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."
I tried running the suggested command but it stated that
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)
Has anyone encountered this before and found a solution?
I just had exactly the same issue when running
tox
.Steps to solve:
setup.py
to containpandas==0.23.0
(instead of0.21.0
)..tox
directorytox
again.Pandas has portions of its code written in C to make it run faster. If you tried to install pandas manually you would need to build it. Try reinstalling it with miniconda package manager here: http://conda.pydata.org/miniconda.html
and then you can just do
There are very simple instructions on how to do it in the link below. Just do ctrl-f miniconda to find the section that talks about it
http://pandas.pydata.org/pandas-docs/dev/install.html
Actually, none of these answers worked for me in the following environment:
The following solution worked, after reading
https://github.com/pandas-dev/pandas/issues/18281
and
https://github.com/pandas-dev/pandas/issues/16715
which both addressed interim solutions and later recommended upgrading,
so I integrated into the Dockerfile
which is mentioned in https://github.com/pandas-dev/pandas/issues/16715#issuecomment-310063504
I tried all solutions mentioned here, except the accepted answer, also because a) I don't want anaconda in a web production environment and b) it's not a good answer to foster frameworks or cli-solutions for architectures, where a package is not used standalone...
Furthermore, I dislike @colo's answer being downvoted, because it actually is a feasible solution in a certain environment.
For anyone finding this thread with similar requirements and expectations like me, I hope to have saved some minutes.
I was unable to upgrade pandas with regular
However bumping it with:
solved issue completely
I was having this problem with python 2.7.13 here is my solution: 1. install Cython with
2. install g++ and gcc
3. uninstall pandas
4. reinstall pandas
then everything will be OK.