Python, Pandas datareader and Yahoo Error RemoteDataError: Unable to read URL

Viewed 23863
2 Answers

This has been answered here already. Since now requires headers, pandas and pandas-datareader must be updated. Other libraries working with pdr might give you issues until gets updated or you modify the part of the code which retreives data.

Have a nice day ;).

pip install --upgrade pandas
pip install --upgrade pandas-datareader

If you are using Colab, run:

!pip install --upgrade pandas-datareader

...
Installing collected packages: pandas-datareader
  Attempting uninstall: pandas-datareader
    Found existing installation: pandas-datareader 0.9.0
    Uninstalling pandas-datareader-0.9.0:
      Successfully uninstalled pandas-datareader-0.9.0
Successfully installed pandas-datareader-0.10.0
WARNING: The following packages were previously imported in this runtime:
  [pandas_datareader]
You must restart the runtime in order to use newly installed versions.

Go to Runtime -> Restart runtime. Then you can import pandas_datareader and check that it's the right version:

import pandas_datareader
pandas_datareader.__version__  # Should show 0.10.0
Related