-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConnectionError #2024
Comments
Mysteriously working now |
Reappeared again today. Was problematic before open yesterday (9:30am EDT), then mysteriously resolved and worked the rest of the day. Today worked before 9:30am but then after 9:30am get error. |
Happened again this morning. All quotes N/A |
Working now. I guess intermittent issue? Could be Yahoo servers? |
Happening again (5am). Issue with Yahoo servers? Throttling? |
Are you spamming? #1513 |
Ah no. Real issue. Worked fine all day yesterday. Worked this morning for a while then N/A now. |
Now some quotes coming through. I think it's yahoo servers(?). |
yfinance stores cookie here: https://github.com/ranaroussi/yfinance#persistent-cache-store - does deleting it help? |
I am on WIN11 and there is no directory called py-yfinance here: Windows = C:/Users/<USER>/AppData/Local/py-yfinance I also don't have yf.set_tz_cache_location("custom/cache/location") |
All quotes were N/A a second ago and just now flashed real quote. |
... how did you check yfinance version? |
PS C:\Users\Bill\Documents\Python> pip show yfinance |
PIP can be wrong. Use the method in the new issue form. |
Back to N/As again |
import yfinance as yf ; print(yf.version) |
Regardless, if you don't have |
Ok I uninstalled yfinance rebooted and reinstalled yfinance. Quotes seem to be working now. Do you think that should clear the issue? I'll let you know if something happens. Thanks for all your help! pip uninstall yfinance |
New error even after uninstalling/reinstalling. |
1 Failed download: Happens to any/all tickers |
Maybe it's their severs? Right at 9:30am all quotes worked today. |
1/2 an hour into the trading day and all quotes working fine. Must be something sporadic with Yahoo servers during ETH. |
I wrote some reconnection python code and it seems to be working with that.
|
Describe bug
1 Failed download:
['UPRO']: ConnectionError(MaxRetryError('HTTPSConnectionPool(host='fc.yahoo.com', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000001AD4DB41FD0>: Failed to resolve 'fc.yahoo.com' ([Errno 11001] getaddrinfo failed)"))'))
This happens for all tickers. UPRO is just an example.
Simple code that reproduces your problem
import yfinance as yf
import pandas as pd
def fetch_data(tickers):
ticker_data = {}
for ticker in tickers:
try:
data = yf.download(ticker, 5d, 1m, threads=True)
if not data.empty:
ticker_data[ticker] = data['Close']
else:
ticker_data[ticker] = None
except Exception as e:
ticker_data[ticker] = None
return ticker_data
def update_data(tickers):
ticker_data = fetch_data(tickers)
def run_script():
tickers = ["UPRO"]
update_data(tickers)
if name == "main":
run_script()
Debug log
1 Failed download:
['UPRO']: ConnectionError(MaxRetryError('HTTPSConnectionPool(host='fc.yahoo.com', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000001AD4DB41FD0>: Failed to resolve 'fc.yahoo.com' ([Errno 11001] getaddrinfo failed)"))'))
[100%%*] 1 of 1 completed
1 Failed download:
['UPRO']: ConnectionError(MaxRetryError('HTTPSConnectionPool(host='fc.yahoo.com', port=443): Max retries exceeded with url: / (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x000001AD4DC65A10>: Failed to resolve 'fc.yahoo.com' ([Errno 11001] getaddrinfo failed)"))'))
Bad data proof
No response
yfinance
version0.2.41
Python version
3.11
Operating system
WIN11
The text was updated successfully, but these errors were encountered: