Q:

Failing to import pandas-datareader, "ImportError: cannot import name 'StringIO' from 'pandas.compat'"

I'm trying to retrieve data using pandas datareader, but when I try to import it, it will not run generating the error below. I have installed the latest pandas and pandas-datareader through pip.
On a similar question they claimed they solved it by just downgrading to an older version of pandas and pandas-datareader, although when I try to reciprocate this result, it fails to downgrade the two and still continues to have these errors. I had more code earlier and thought that the problem lied within the code, but when I decided to comment out everything I realized that the error occurred during importing as shown below. There is also more to the error message below but I believe I included the important part, as the rest is just the traceback.
import pandas as pd
import pandas_datareader as web

ImportError: cannot import name 'StringIO' from 'pandas.compat' (/Users/roshanamir/Desktop/AI/Pycharm/ATM2/venv/lib/python3.7/site-packages/pandas/compat/__init__.py)

Any help would be appreciated, thank you in advance.

A:

pandas.compat.StringIO was removed when pandas stopped supporting Python 2 in version 0.25.0.
This has been repaired in pandas datareader and will be released in 0.8.0. For now, download the latest development version where the changes are live.

