1

I cannot import pandas_datareader on my jupyter notebook(via anaconda, python3) on my windows 10 laptop. It has been installed and I can see the file but It's having errors with importing into the jupyter notebook file. Any help?

I have tried : pip install pandas-datareader , pip3 install pandas-datareader , conda install -c anaconda pandas-datareader

I expect the the code to run smoothly however I get

ModuleNotFoundError Traceback (most recent call last) in () ----> 1 import pandas_datareader

ModuleNotFoundError: No module named 'pandas_datareader'

  • My first guess is that you're installing the package in a different `env` and running jupyter notebook in a different one. Can you check the top right corner of your jupyter notebook to see `Python [env_name]`. `env_name` would be the env jupyter is running on. Go to anaconda prompt and `source activate env_name`. After which, you can try installing the package and running jupyter again. – razdi Sep 11 '19 at 23:20

2 Answers2

2

Most obvious reason can be that you are using differnt enviroments(kernels) for jupyter notebook and others. Try running this code inside jupyter notebook empty project:

try:
    from pip._internal.operations import freeze
except ImportError:  # if your pip version is bigger then 10
    from pip.operations import freeze

requirements = freeze.freeze()
for i in requirements:
    print(i)

and check if there are your's missing imports

Misieq
  • 507
  • 2
  • 12
0

You have to run CMD Prompt from Anaconda navigator or find it from Start menu. Then use this command:

conda install pandas_datareader 

I underwent similar difficulties and successfully fixed thanks to this post - Trouble installing some libraries in python (oauth2client and gspread) Conda is installing packagies to environment for Anaconda which is obviously different than pip uses.

Pavel Petr
  • 51
  • 8