Reputation: 767
I have just installed pandas_datareader
using pip install pandas-datareader
which ran successfully.
Now I am trying to use it for a tutorial and I am getting this error when I try to import.
import pandas_datareader as pdr
ModuleNotFoundError: No module named 'pandas_datareader'
This is the link to the tutorial.
https://www.datacamp.com/community/tutorials/finance-python-trading#gs.DgsO1BY
Any ideas?
Upvotes: 27
Views: 145301
Reputation: 11
This problem also bothers me constantly. But this method will usually solve it.
Open the [setting] window and then find [python interpreter]. Click on the + mark on top of the many packages names. Then use the search function to find the package you need, install it, and import it in the code.
Upvotes: 1
Reputation: 1
I was facing same problem which was solved when I ran this code on the conda terminal:
conda install pandas-datareader
I don't know why it was not working but this solved my problem.
Upvotes: 0
Reputation: 1
if you facing this error ,you have have to install pandas_datareader. you can install this package by Jupyter notebook also. "pip install pandas_datareader"
Upvotes: 0
Reputation: 1
I was having the same issue. I tried pip install pandas-datareader, pip install pandas_datareader, python3 -m pip install pandas_datareader on termianl, I see message saying I have successfully installed the package but none of them worked. I use Pycharm as my IDE and when I checked File-->Setting-->Progect:File-->Python interpreter, pandas-datareader is not in the package list. I use anaconda as my python Interpreter. So, just added the package into the interpreter and finally worked.
Upvotes: 0
Reputation: 41
I was having this same issue in Jupyter Notebook, where it wasnt recognizing pandas_datareader, even though it said that it was installed successfully in anaconda prompt.
I figured out that my jupyter notebook wasnt opening up in my environment. I activated my environment in Anaconda Prompt and then did conda install nb_conda_kernels. When I opened up Jupyter notebook and checked my env, I was in the correct one, and it recognized my pandas_datareader import. You can check your environment using:
import sys
print(sys.prefix)
This is a SO thread that helped me: Conda environments not showing up in Jupyter Notebook
Upvotes: 1
Reputation: 11
I had the same issue installing through my terminal. Since I'm using Anaconda Navigator, I tried the CMD.exe Prompt and inputted "conda install -c conda-forge pandas-datareader".
Jupyter notebook now works like a charm.
Upvotes: 1
Reputation: 293
You may consider upgrading your pandas with:
pip3 install --upgrade pandas
Upvotes: 0
Reputation: 149
If you are facing this issue in Jupyter Notebook, just restart the kernel within the IDE. -Make sure u have installed pandas_datareader with "pip install pandas_datareader" -Click on the tab named 'kernel' -Click Restart
Your Problem will be resolved
Upvotes: -1
Reputation: 61
For me, Import pandas_datareader worked from the command prompt while using python but did not work in jupyter.
From inside jupyter in a cell, I ran pip install pandas_datareader
I got a whole host of "Requirement already satisfied" messages
But at the very end, I was given this very important message. Successfully installed pandas-datareader-0.8.1 Note: you may need to restart the kernel to use updated packages In Jupyter notebook.
There is a kernel menu command sitting between cell and widgets. The restart command is in that drop-down menu option. In my case, this restarting of the kernel was the solution to my " No module named 'pandas_datareader' " all along.
Upvotes: 6
Reputation: 445
Had the same issue. This resolved it for me:
after activating the env, run:
pip install pip --upgrade
pip install pandas-datareader
pip install jupyter (as i was using a jupyter notebook)
However, if you are running anaconda, use:
conda install -c anaconda pandas-datareader
Upvotes: 4
Reputation: 51
All the other methods didn't work for me.
In command prompt:
conda install -c delichon pandas_datareader
This is working fine on 22nd sept 2019 make sure to update pip.
Upvotes: 5
Reputation: 11
Got this error even though I had pandas_datareader installed. Running on Windows. py -3 -m pip install pandas_datareader
in the command prompt didn't work. Same in anaconda prompt didn't work. pip uninstall pandas_datareader
followed by pip install pandas_datareader
and a reboot finally fixed my problem.
TLDR if running on a Windows machine, uninstall pandas_datareader if you have it (pip uninstall pandas_datareader
) and then reinstall with 'pip install pandas_datareader'.
Upvotes: 1
Reputation: 11
I had the same problem. I tried pip install pandas_datareader in my Anaconda Prompt and the problem was solved. For some reason, it didn't work in command prompt.
Upvotes: 1
Reputation: 61
Ok the following steps resolved the "No module named 'pandas_datareader" issue for me. To be clear, my situation was such that I had already installed pandas_datareader via pip install pandas_datareader
but the "No module named 'pandas_datareader" error still kept popping up whenever I ran a .py code that imports pandas_datareader.
If you are in the same situation as I was (on Mac), this may help you.
Step 1: Uninstall the pandas_datareader package first:
pip uninstall pandas_datareader
Step 2: Restart your IDE if you were using one
Step 3:: re-install pandas_datareader package
again via terminal, type pip install pandas_datareader
your terminal may show you a bunch of "pre-installed" pandas_datareader package with message "Requirement already satisfied..."
ignore those.
Step 4: Run your python code again
Hope this helps.
Upvotes: 6
Reputation: 1154
Go to C:\Users\[UserName]\AppData\Roaming\jupyter\kernels\python3
and open up kernel.json
. Check the first argument is pointing to a Python 3 environment/the environment you installed pandas_datareader to.
Upvotes: -1