0
votes

When importing pandas_datareader.data as web, I am getting the following error:

ImportError: cannot import name 'assert_raises_regex' from 'pandas.util.testing'

I am using Spyder from the Anaconda Navigator and I have tried updating Spyder, Anaconda and made sure I had the latest version of pandas

I am new to python so I might be missing something...

1
try to import numpy, to install it use "pip3 install numpy" to use it: "numpy.testing.assert_raises_regex()"Ro0t
thanks for your reply ! I tried what you suggested but it does not seem to work. To clarify I am trying to access data from the Fred API using pandas datareaderLoïc Simonet
Installing NumPy with pip is a bad idea if you're using Conda. Can you share the contents of the environment, as well as how you installed the packages?AMC

1 Answers

0
votes

You should install the latest version of pandas-datareader from anaconda as the warning sayspandas.util.testing is being deprecated in favor of pandas.testing. A look at the source https://github.com/pydata/pandas-datareader/blob/master/pandas_datareader/compat/init.py shows the pandas_datareader.compat module using pandas.testing instead.