yfinance has completely stopped working
See original GitHub issueI can’t find any info on this issue, but I have no idea why it’s happening. Been using yfinance to pull data from a few hundred stocks each day, and it’s been working fine for a few months. Then last night, suddenly every single ticker symbol gives a “SymbolWarning: Failed to read symbol” error. Every single one. Tried running the code again, tried waiting until this morning to run it, it’s still happening. Is it possible yahoo is blocking my IP address or something? I tried adding a time.sleep method of 1 second between each stock to avoid this, but it doesn’t seem to have done anything, so I removed it.
Code below: `import pandas_datareader as web from datetime import datetime import pandas as pd
start = datetime(2020,9,1) end = datetime(2021,12,31) stock = [ ‘ACHC’, ‘ACIW’, [many more stocks listed here cut for simplicity], ‘TECH’, ‘SAM’]
df = web.DataReader(stock, ‘yahoo’, start, end) df.to_excel(f’excelfilename.xlsx’)`
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top Related StackOverflow Question
This works:
https://github.com/ranaroussi/yfinance/pull/749
@matt-wetmore If you just want to suppress the warning:
This suppression is ugly but it looks to work for me.