模块"pandas_datareader"没有属性"get_data_yahoo" [英] module 'pandas_datareader' has no attribute 'get_data_yahoo'
问题描述
I've installed pandas-datareader with:
conda install -c https://conda.anaconda.org/anaconda pandas-datareader
I'm running on windows 10, with pycharm, and anaconda3 interpreter
我正在尝试运行最基本的内容:
I'm trying to run the very basic:
import pandas_datareader as pdr
pdr.get_data_yahoo('AAPL')
但是我得到一个错误:
File "D:/Dropbox/Duo/documents docs/Projects/F500AquisitionQuality/m_and_a_quality/stock_utils.py", line 2, in <module>
pdr.get_data_yahoo('AAPL')
AttributeError: module 'pandas_datareader' has no attribute 'get_data_yahoo'
But I get an error:
File "D:/Dropbox/Duo/documents docs/Projects/F500AquisitionQuality/m_and_a_quality/stock_utils.py", line 2, in <module>
pdr.get_data_yahoo('AAPL')
AttributeError: module 'pandas_datareader' has no attribute 'get_data_yahoo'
请注意,文件名与熊猫无关,如 reddit评论(我可以在网上找到的唯一相关内容)
Please note that the filename has nothing to do with pandas as in this reddit comment (the only related thing i could find online)
推荐答案
0.4.0版中的get_data_yahoo存在问题(因为Yahoo更改了API).
There is a problem with get_data_yahoo in version 0.4.0 (because Yahoo changed API).
要修复此问题,您可以安装版本0.4.1 (它尚未合并 https://github.com/pydata/pandas-datareader/pull/331 (截至2017年5月20日)
To fix it you can install version 0.4.1 (it's not merged yet https://github.com/pydata/pandas-datareader/pull/331 as for May 20 2017)
下面的代码对我有所帮助.我克隆了pandas-datareader源代码,更改了分支,并使用pip3从源代码安装了软件包
Following code helped me. I cloned pandas-datareader source code, changed branch, installed package from source code using pip3
git clone https://github.com/pydata/pandas-datareader
cd pandas-datareader/
git remote add rgkimball http://github.com/rgkimball/pandas-datareader
git fetch rgkimball fix-yahoo
git checkout fix-yahoo
pip3 uninstall pandas_datareader
python3 setup.py install
git clone https://github.com/pydata/pandas-datareader
cd pandas-datareader/
git remote add rgkimball http://github.com/rgkimball/pandas-datareader
git fetch rgkimball fix-yahoo
git checkout fix-yahoo
pip3 uninstall pandas_datareader
python3 setup.py install
这篇关于模块"pandas_datareader"没有属性"get_data_yahoo"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!