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?
Enter the command “pip install pandas” on the terminal. This should launch the pip installer. The required files will be downloaded, and Pandas will be ready to run on your computer. After the installation is complete, you will be able to use Pandas in your Python programs.
The Python "ModuleNotFoundError: No module named 'pandas'" occurs when we forget to install the pandas module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install pandas command.
The easiest way to install pandas is to install it as part of the Anaconda distribution, a cross platform distribution for data analysis and scientific computing. This is the recommended installation method for most users.
I was having the same problem now with Python 3.4.3.
I was using pandas-0.18.0.
Upgrading (using pip) solved the issue for me:
[sudo] pip install --upgrade pandas
The final result of the upgrade:
Successfully installed numpy-1.13.3 pandas-0.21.0 python-dateutil-2.6.1 pytz-2017.3 six-1.11.0
After this, the issue was gone!
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
conda install pandas
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With