Python yfinance HTTPError:HTTP 错误 404:未找到

时间:2021-07-11 22:08:37

标签: python http-status-code-404 yfinance

我是 Python 新手,我正在尝试探索 yfinance。这在几个月前有效,但最近当我尝试使用任何 yfinance 模块执行我的代码时,出现以下错误:

import yfinance as yf
stock='AAPL'
stock_yfin=yf.Ticker("{}".format(stock))
# show institutional holders
stock_yfin.institutional_holders

------------>

HTTPError: HTTP Error 404: Not Found

有没有办法解决这个问题?我已经考虑过更改我的标题和会话信息,但似乎无法弄清楚。

1 个答案:

答案 0 :(得分:1)

将您的 yfinance 软件包更新为:

pip install yfinance --upgrade --no-cache-dir

在您使用的虚拟环境或全局范围内。