yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

"No data found, symbol may be delisted"

Open ChristofNies opened this issue 2 years ago • 14 comments

YFinance Version: Currently 0.2.3, also tried on 0.2.2, 0.2.1 and 0.1.96

Operating System: Windows 11 Enterprise

Code: msft = yf.download(tickers='MSFT', period='1mo', interval='5m') msft

Error: [100%**] 1 of 1 completed

1 Failed download:

  • MSFT: No data found for this date range, symbol may be delisted

ChristofNies avatar Dec 29 '22 23:12 ChristofNies

can you print the yfinance version number from the code to make sure it uses the right version?

I'm using 0.2.3 with windows 11 without issues (and worked also with 0.1.94 before that). Also - which version of python are you using?

galashour avatar Dec 30 '22 11:12 galashour

Yes I added the print line that was in the issue creation info and it used the right version after up- and downgrading the version of yfinance.

I'm new to python and finance with python/data science etc. and I'm following a tutorial on it, so I'm sorry if I don't provide you with the best information. I will try to give you all the context you might need: I installed Python 3.9.13 and afterwards Anaconda. But I'm using the code within a Jupyter Notebook (6.4.12 it says within my navigator) that I run via Anaconda Navigator.

Version screenshot: Versions condaInfo

ChristofNies avatar Dec 30 '22 19:12 ChristofNies

I am also getting the same issue

I have used yfinance as an override for PDR but getting

This error

1 F1 Failed download:
- AAPL: No data found for this date range, symbol may be delisted

This is My code

from pandas_datareader import data as pdr
import yfinance as yf
yf.pdr_override()

user_input = st.text_input('Enter Stock Ticker', 'AAPL')


df = pdr.get_data_yahoo(user_input, start="2017-01-01", end="2017-04-30")
display(df)

looper15 avatar Dec 31 '22 23:12 looper15

Same here, using version 0.2.3 and I get a "No summary info found, symbol may be delisted" for every symbol. I am using Anaconda + Jupyterlab if that helps, and I updates the yfinance package with pip install yfinance --upgrade --no-cache-dir recently

molecula21 avatar Jan 02 '23 13:01 molecula21

Can a Jupyter user debug the root cause?

ValueRaider avatar Jan 02 '23 13:01 ValueRaider

Also tried this solution: #359. But it didn't seem to help

ChristofNies avatar Jan 04 '23 13:01 ChristofNies

I have the same issue. yfinance-0.2.3;

Enigma-song avatar Jan 04 '23 18:01 Enigma-song

Just an observation I'm making based on times of trying a few different tickers, in different markets: I can only access the data for a ticker if I am running the calls while the market is open. I was querying data earlier today (around 12.00 pm MST) for the tickers: RNW.TO, GOOGL, BTCW.V, BA, ORCL, ZDV.TO; but when I was trying just recently (around 3.30 pm MST, after market close) I was unable to get the data. I found no mention of this being the case, so just thought I'd let others know that it might be related.

cwyz-dev avatar Jan 04 '23 22:01 cwyz-dev

Hey @cwyz-dev, I just observed the same. During market hours I got all the symbols I use to look at (VWCE.DE, VUAA.DE, EQQQ.PA, FGEQ.DE, XAIX.DE, GFEA.DE, SGLD.AS, IQQX.DE) to be fully populated. That happened once. Running the same script a few minutes later yielded the same "No summary info found, symbol may be delisted" for some of them.

molecula21 avatar Jan 05 '23 14:01 molecula21

Is this problem only Jupyter + Anaconda? Has anyone with a different setup had the same issue? I'm still facing the same chalenge, only once in a while my script is able to pick up the entirety of the symbols.

molecula21 avatar Jan 11 '23 21:01 molecula21

Is this problem only Jupyter + Anaconda?

I only assume this as appears to be common denominator. What is your execution environment?

ValueRaider avatar Jan 11 '23 21:01 ValueRaider

Same problem here with yfinance 0.2.3. I do not use Jupyter or Anaconda but plain as follows:

print(yf.Ticker(ticker_name).info["regularMarketPrice"])

Output: "No summary info found, symbol may be delisted" for the last few days.

thomai avatar Jan 16 '23 12:01 thomai

Could it be the same as #1387 i.e. related to cache tz retrieval?

vidalmarco avatar Feb 01 '23 12:02 vidalmarco

@Vidal4SigurRos Absolutely not because that would print "No timezone found, symbol may be delisted"

Because this issue seems to be affecting tiny % of users, they need to debug and provide some clues if not a fix.

ValueRaider avatar Feb 01 '23 12:02 ValueRaider

Any updates on this issue. I am facing this issue as well. The only common factor I am able to observe is that the message "No data found for this date range, symbol may be delisted" is only displayed off market hours. When I try during market hours, my program runs as intended. For further information, I am running a Jupyter Notebook in VS Code.

realgauravmehta avatar Mar 07 '23 07:03 realgauravmehta

I did some digging for my problem and added an Exception print in the try-except-clause (base.py lines 673-695), seems like the "localize" call might be the culprit.

'datetime.timezone' object has no attribute 'localize'

I just got the "No data found, symbol may be delisted" for the interval="max", interval="10y" worked fine. Commenting out lines 675-681 in base.py solved my issue for the "max" interval. The read from cache functionality will then not be used, not sure how that will affect the data though.

NOTE: everything worked fine for me until i updated yfinance and pandas. Previous versions pandas==1.3.5 yfinance==0.1.63.

Hope this might be of use for someone!

TapeReaderJoe avatar Mar 11 '23 12:03 TapeReaderJoe

seems like the "localize" call might be the culprit.

'datetime.timezone' object has no attribute 'localize'

Provide the traceback, so know which call you mean.

Also, when this exception occurs print the object - type & value, of both the date/datetime object and it's tzinfo attribute. I think we're close to a fix, I can smell it.

ValueRaider avatar Mar 11 '23 12:03 ValueRaider

seems like the "localize" call might be the culprit.

'datetime.timezone' object has no attribute 'localize'

Provide the traceback, so know which call you mean.

Also, when this exception occurs print the object - type & value, of both the date/datetime object and it's tzinfo attribute. I think we're close to a fix, I can smell it.

https://github.com/ranaroussi/yfinance/blob/1edeaf07dc8ea9129e37f08dc770c1e3a16f431f/yfinance/base.py#L654

TapeReaderJoe avatar Mar 11 '23 12:03 TapeReaderJoe

I think fix is this: replace this line:

https://github.com/ranaroussi/yfinance/blob/1edeaf07dc8ea9129e37f08dc770c1e3a16f431f/yfinance/base.py#L654

with this:

dt_now = pd.Timestamp.utcnow()

Try that and report back

ValueRaider avatar Mar 11 '23 12:03 ValueRaider

dt_now = pd.Timestamp.utcnow()

it doesn't work

YUYANGSHEN avatar Mar 11 '23 15:03 YUYANGSHEN

I have the duplicated error “No timezone found, symbol may be delisted”. how to solve it?

YUYANGSHEN avatar Mar 11 '23 15:03 YUYANGSHEN

I have the duplicated error “No timezone found, symbol may be delisted”. how to solve it?

Note: I use a proxy to access the internet

YUYANGSHEN avatar Mar 11 '23 15:03 YUYANGSHEN

I have the duplicated error “No timezone found, symbol may be delisted”. how to solve it?

No idea. You have to debug

ValueRaider avatar Mar 11 '23 16:03 ValueRaider

I think fix is this: replace this line:

https://github.com/ranaroussi/yfinance/blob/1edeaf07dc8ea9129e37f08dc770c1e3a16f431f/yfinance/base.py#L654

with this:

dt_now = pd.Timestamp.utcnow()

Try that and report back

That solved my issue, ty!

TapeReaderJoe avatar Mar 11 '23 16:03 TapeReaderJoe

@TapeReaderJoe Can you submit a Pull Request? #1084

ValueRaider avatar Mar 11 '23 17:03 ValueRaider

@TapeReaderJoe Can you submit a Pull Request? #1084

I have solved this issue through replace the main branch by the proxy fixed branch. thx

YUYANGSHEN avatar Mar 12 '23 05:03 YUYANGSHEN

I have the duplicated error “No timezone found, symbol may be delisted”. how to solve it?

No idea. You have to debug

thx guys. I have solved this issue just replace by a right branch

YUYANGSHEN avatar Mar 12 '23 05:03 YUYANGSHEN

dt_now = pd.Timestamp.utcnow()

Hi @ValueRaider, first-timer here. I met the same issue today and saw your solution proposed. I'm curious about which line in the branch you mentioned to change.

KevinYew97 avatar Apr 07 '23 10:04 KevinYew97

@KevinYew97 I've edited that post with a working link

ValueRaider avatar Apr 07 '23 10:04 ValueRaider

Thanks! @ValueRaider. I have changed that particular code, but it's not working for me, both pdr_override and normal yf.download. I've tried with list of stocks and individual stocks, and no avail.

KevinYew97 avatar Apr 07 '23 13:04 KevinYew97