python - yfinance 不工作 - 接收 json.decoder.JSONDecodeError
问题描述
我正在从 yfinance 抓取股市数据。在过去的几周里,我的代码运行良好。出于某种原因,现在我收到以下错误:
json.decoder.JSONDecodeError:期望值:第 1 行第 1 列(字符 0)
执行时:
import yfinance as yf
tsla_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 uninstall yfinance
pip install git+https://github.com/ranaroussi/yfinance.git#egg=yfinance
推荐阅读
- snowflake-cloud-data-platform - Snowflake pipe_usage_history:关于信用和成本的问题
- c# - VS2017 Directory.Build.props 不加载整个解决方案
- c# - 从数据库计算时间
- swift - 如何在计数器中有一个日期变量更新年份
- java - 如何在 executorCompletionService 中使用 concurrentHashMap?
- loops - 使用循环将代理类型设置为空闲,当处于该状态时将接受代理,如果忙则拒绝
- javascript - Bootstrap 3 工具提示箭头无法正确显示多行消息
- python - Matplotlib;使用不同的轴标签制作不同的子图
- postgresql - 如何在休眠的 nativeQuery 中投射空日期?
- c - 数组不打印?