Im just learning python and trying to use it for stock anlyses. using stockstats.
I installed stockstats by pip install stockstats
imported pandas import pandas
tried to import data import pandas.io.data got a error saying module pandas.io.data does not exist
I got this error out of the box with Anaconda 4.4:
>>> import pandas.io.data
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/anaconda3/lib/python3.6/site-packages/pandas/io/data.py", line 2, in <module>
"The pandas.io.data module is moved to a separate package "
ImportError: The pandas.io.data module is moved to a separate package (pandas-datareader). After installing the pandas-datareader package (https://github.com/pydata/pandas-datareader), you can change the import ``from pandas.io import data, wb`` to ``from pandas_datareader import data, wb``.
The error message is pretty nice. It recommends you go install pandas-datareader
from https://github.com/pydata/pandas-datareader
. Then change your import to from pandas_datareader import data
.
Or you can just pip install pandas-datareader
.
After that, from pandas_datareader import data
works as expected:
Matthews-MacBook-Pro:python matt$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pandas_datareader import data
>>>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With