yfinance: Failed downloads - "No timezone found, symbol may be delisted"

Hi yfinance team, start_date = '2020-01-02' end_date = '2022-01-01' ticker_list = ['META', 'GOOG', 'ORCL', 'MSFT', 'AMZN'] data = yf.download(ticker_list, start=start_date, end=end_date, ignore_tz=True)[['Close']]

I’m using the above code snippet to download 5 tickers’ data, but I got the following error messages no matter if I changed ignore_tz to False or True.

[100%**] 5 of 5 completed

5 Failed downloads:

  • AMZN: No timezone found, symbol may be delisted
  • META: No timezone found, symbol may be delisted
  • GOOG: No timezone found, symbol may be delisted
  • MSFT: No timezone found, symbol may be delisted
  • ORCL: No timezone found, symbol may be delisted

Screenshot 2023-01-31 at 10 29 45 AM

yfinance version: 0.2.9 python version: 3.8.5 Operating system: Azure Machine Learning Studio or my kernel is Python 3.8 - AzureML

Please help me figure it out. I really appreciate any help you can provide.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 55 (26 by maintainers)

Most upvoted comments

In the meantime I did the following test by using old-style debug approach and insert print statements in base.py and data.py (To be noted that to test we need a brand new ticker never cached before). For a cached ticker both codes (i.e. with or without the last line) work.

Bottom line Differences seem related to frozendict usage behind the scene… and removing the last line seems indeed to be just a side-effect workaround

With the last line:

    # setup proxy in requests format
    if proxy is not None:
        if isinstance(proxy, dict) and "https" in proxy:
            proxy = proxy["https"]
        proxy = {"https": proxy}

Output: Download the historical stock prices for ^N225:

base.py, TickerBase:history():after fix/fetch_tx_via_proxy block:proxy: {‘https’: ‘10.xx.xxx.xx:pppp’} base.py, TickerBase:_fetch_ticker_tz():before _data.cache_get:proxy: {‘https’: ‘10.xx.xxx.xx:pppp’} data.py,TickerData::get:before proxy reformat:proxy–> frozendict.frozendict({‘https’: ‘10.xx.xxx.xx:pppp’}) data.py,TickerData::get:after proxy reformat and before _session.get():proxy–> {‘https’: frozendict.frozendict({‘https’: ‘10.xx.xxx.xx:pppp’})}

1 Failed download: ^N225: No timezone found, symbol may be delisted

Without the last line:

    # setup proxy in requests format
    if proxy is not None:
        if isinstance(proxy, dict) and "https" in proxy:
            proxy = proxy["https"]

Output Download the historical stock prices for ^N225:

base.py, TickerBase:history():after fix/fetch_tz_via_proxy block:proxy: 10.xx.xxx.xx:pppp base.py, TickerBase:_fetch_ticker_tz():before _data.cache_get–>proxy: 10.xx.xxx.xx:pppp data.py,TickerData::get():before proxy reformat:proxy–> 10.xx.xxx.xx:pppp data.py,TickerData::get():after proxy reformat and before _session.get():proxy–> {‘https’: ‘10.xx.xxx.xx:pppp’} data.py,TickerData::get():before proxy reformat:proxy–> 10.xx.xxx.xx:pppp data.py,TickerData::get():after proxy reformat and before _session.get():proxy–> {‘https’: ‘10.xx.xxx.xx:pppp’}

490 observation dowloaded.