I am running a iPython notebook via the Anaconda Navigator app (version 1.1.0). When I want to import pandas it gives me a strange error. I thought the Anaconda app included
Try in your console
conda install pandas
and see what's the message given.
yes, the Anaconda distribution includes pandas, type
conda list
to get a list of the packages installed.
I had a similar issue since I installed pandas
using python -m pip install pandas --upgrade --user
which installed a conflicting version in my user python packages directory, masking the Anaconda installed version that other dependencies relied upon.
conda list | grep pandas
pandas == 0.23.4
python -m pip list | grep pandas
pandas == 0.24.0
So uninstalling the user directory masked version cleaned up the issue for me.
python -m pip uninstall pandas
For reference all possible python packages are installed in the directories listed from this command:
python -m site
Might be worth iterating through these and checking for duplicates.
Edit: Since my original answer I learnt you can run:
python -m pip list -v
And it shows the directory the library is installed. This often shows whether the library you want is in a virtual environment, conda environment, user directory, system site packages etc.
I faced the same problem and I solved it using the following steps:
Actually, there is a pandas version conflict, which would get resolved automatically by following the above steps.
Stay Blessed!
There's this bug in the latest version of pandas (pandas 0.23) that gives you an error on importing pandas.
But this can be easily fixed by installing an earlier version of pandas (pandas 0.22) using the command pip install pandas==0.22
on Windows Command Prompt.
I recently came across the same problem right after I installed Pandas 0.23 in Anaconda Prompt. The solution is simply to restart the Jupyter Notebook which reports the error. May it helps.