how to solve importing pandas datareader in jupyter using conda

179 Views Asked by At

I downloaded pandas data reader in Conda using this command -conda install -c anaconda pandas-data reader

after I downloaded I got this error can you guys tell me how to fix it

ModuleNotFoundError Traceback (most recent call last) Cell In[3], line 1 ----> 1 import pandas_datareader as pdr ModuleNotFoundError: No module name

I am expecting how to solve this error I used instruction from here it showing this error can you tell me how to solve this one

2

There are 2 best solutions below

0
Umar On

Within Jupyter: Go to "Kernel" > "Restart" to refresh the environment and load new packages.

Use %conda Magic: If the above steps don't work, try installing directly within Jupyter using the %conda magic command:

 %conda install -c anaconda pandas-datareader

Consider conda-forge Channel: If issues persist, try installing from a different channel: conda install -c conda-forge pandas-datareader

also Check Case Sensitivity: Make sure you're importing correctly: import pandas_datareader as pdr

Alternative Installation via pip: Run pip install pandas-datareader in your terminal or Anaconda Prompt.

Check Installation: Open a terminal or Anaconda Prompt and run

conda list

Conflicting Packages: In rare cases, conflicts with other packages might occur. Try creating a new environment using conda create -n myenv pandas-datareader and running Jupyter Notebook within that environment.

0
Tamilselvan Arjunan On

First install using conda, conda install pandas-datareader

if its not successful,

conda install git+https://github.com/pydata/pandas-datareader.git

Then go to, Jupyter: Go to "Kernel" > "Restart" to refresh the environment and load new packages. Finally you can import using below command

import pandas_datareader as pdr