问题描述
我正在从 yfinance 抓取股市数据.在过去的几周里,我的代码运行良好.出于某种原因,现在我收到以下错误:
json.decoder.JSONDecodeError:期望值:第 1 行第 1 列(字符 0)
执行时:
将 yfinance 导入为 yftsla_df = yf.download('TSLA', start='2020-01-01', end='2021-01-01', progress=False)
我在 Stack Overflow 上读到过这个错误,但没有人有合适的解决方案来解决这个问题.我想知道因为这个简单的代码几天前运行良好.那么目前 yfinance API 是否存在普遍问题?任何人都可以确认或有解决此问题的方法吗?
yfinance已经提出问题,需要升级
关注这里
https://github.com/ranaroussi/yfinance/issues/764
来自github:
如果您收到与 json.decoder.JSONDecodeError 相关的错误,请升级到 yfinance 0.1.62.升级使用:
$ pip install yfinance -U--no-cache-dir
完整对话在这里:https://github.com/ranaroussi/yfinance/issues/760
我无法修复工作,但此评论对我有用https://github.com/ranaroussi/yfinance/issues/760#issuecomment-877379498
pip卸载yfinancepip 安装 git+https://github.com/ranaroussi/yfinance.git#egg=yfinance
I am scraping stock market data from yfinance. My code worked perfectly during the last weeks. For some reason, now I am receiving the following error:
when executing:
import yfinance as yf
tsla_df = yf.download('TSLA', start='2020-01-01', end='2021-01-01', progress=False)
I have read about this error on Stack Overflow, but no one had an appropriate solution to fix the problem. I am wondering because this simple code worked well days ago. So maybe there is a general problem with the yfinance API at the moment? Can anyone confirm or has a solution for this problem?
Issue has been raised with yfinance, you need to upgrade
Follow here
https://github.com/ranaroussi/yfinance/issues/764
from github:
Full conversation here :https://github.com/ranaroussi/yfinance/issues/760
I couldn't get the fix to work but this comment worked for mehttps://github.com/ranaroussi/yfinance/issues/760#issuecomment-877379498
pip uninstall yfinance
pip install git+https://github.com/ranaroussi/yfinance.git#egg=yfinance
这篇关于yfinance 不工作 - 接收 json.decoder.JSONDecodeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!