pandas_datareader.data not working (Python for Finance tutorial)

by: sanjeevnewar, 7 years ago


I have successfully installed python-datareader and shows in list of packages. However the statement
import pandas_datareader.data as web
generates an error.

Have no clue and have tried all different ways of import. Kindly help as am stuck due to this. Alternatively, can you provide the csv file generated in next tutorial so that I can use it to proceed ahead.
Here is the error message:
Traceback (most recent call last):
  File "pff.py", line 5, in <module>
    import pandas_datareader.data as web
  File "/anaconda/envs/Pythonold/lib/python3.5/site-packages/pandas_datareader/data.py", line 7, in <module>
    from pandas_datareader.google.daily import GoogleDailyReader
  File "/anaconda/envs/Pythonold/lib/python3.5/site-packages/pandas_datareader/google/daily.py", line 1, in <module>
    from pandas_datareader.base import _DailyBaseReader
  File "/anaconda/envs/Pythonold/lib/python3.5/site-packages/pandas_datareader/base.py", line 11, in <module>
    from pandas.core.common import PandasError, is_number
ImportError: cannot import name 'PandasError'



You must be logged in to post. Please login or register an account.



Figured it out. I downgraded pandas to 0.19.1 instead of latest 0.20.1. To be safe, also downgraded pandas-datareader to 0.2.0 instead of 0.2.1. And changed yahoo to google. It worked. Seems latest version of pandas released in May has a compatibility issue.

Lesson learnt - avoid latest versions. You never know which dependency breaks down where. (Earlier, python 3.6 also had some compatibility issues.)

Thanks anyways for wonderful tutorials.

Just a request - please make all data files available at some place so that one can proceed with lessons without much hiccups.

-sanjeevnewar 7 years ago

You must be logged in to post. Please login or register an account.