Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

"No data found, symbol may be delisted" #1268

Closed
ChristofNies opened this issue Dec 29, 2022 · 38 comments
Closed

"No data found, symbol may be delisted" #1268

ChristofNies opened this issue Dec 29, 2022 · 38 comments

Comments

@ChristofNies
Copy link

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
@galashour
Copy link

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?

@ChristofNies
Copy link
Author

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

@looper15
Copy link

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)

@molecula21
Copy link

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

@ValueRaider
Copy link
Collaborator

ValueRaider commented Jan 2, 2023

Can a Jupyter user debug the root cause?

@ChristofNies
Copy link
Author

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

@Enigma-song
Copy link

I have the same issue. yfinance-0.2.3;

@cwyz-dev
Copy link

cwyz-dev commented Jan 4, 2023

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.

@ValueRaider ValueRaider changed the title No data found for any Ticker No data found for any Ticker [Jupyter + Anaconda] Jan 4, 2023
@molecula21
Copy link

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
Copy link

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.

@ValueRaider
Copy link
Collaborator

ValueRaider commented Jan 11, 2023

Is this problem only Jupyter + Anaconda?

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

@thomai
Copy link

thomai commented Jan 16, 2023

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.

@ValueRaider ValueRaider changed the title No data found for any Ticker [Jupyter + Anaconda] "No data found, symbol may be delisted" Jan 16, 2023
@vidalmarco
Copy link
Contributor

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

@ValueRaider
Copy link
Collaborator

ValueRaider commented Feb 1, 2023

@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.

@realgauravmehta
Copy link

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.

@TapeReaderJoe
Copy link

TapeReaderJoe commented Mar 11, 2023

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!

@ValueRaider
Copy link
Collaborator

ValueRaider commented Mar 11, 2023

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.

@TapeReaderJoe
Copy link

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.

dt_now = end_dt.tzinfo.localize(_datetime.datetime.utcnow())

@ValueRaider
Copy link
Collaborator

ValueRaider commented Mar 11, 2023

I think fix is this: replace this line:

dt_now = end_dt.tzinfo.localize(_datetime.datetime.utcnow())

with this:

dt_now = pd.Timestamp.utcnow()

Try that and report back

@YUYANGSHEN
Copy link

dt_now = pd.Timestamp.utcnow()

it doesn't work

@YUYANGSHEN
Copy link

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

@YUYANGSHEN
Copy link

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

@ValueRaider
Copy link
Collaborator

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

No idea. You have to debug

@TapeReaderJoe
Copy link

TapeReaderJoe commented Mar 11, 2023

I think fix is this: replace this line:

dt_now = end_dt.tzinfo.localize(_datetime.datetime.utcnow())

with this:

dt_now = pd.Timestamp.utcnow()

Try that and report back

That solved my issue, ty!

@ValueRaider
Copy link
Collaborator

@TapeReaderJoe Can you submit a Pull Request? #1084

@YUYANGSHEN
Copy link

@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
Copy link

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

@KevinYew97
Copy link

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.

@ValueRaider
Copy link
Collaborator

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

@KevinYew97
Copy link

KevinYew97 commented Apr 7, 2023

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.

@steven9909
Copy link
Contributor

Surprised no one created a PR for this yet :(, created a PR here: #1488

@JoanVendrellC
Copy link

Do you have installed 'ta' library?

Because I had the same issue and I figured out that the error occurred when I installed that library. I have uninstalled it and it's working right now.

@ValueRaider
Copy link
Collaborator

@JoanVendrellC If ta interferes with latest release, create a new Issue

@KingThutmose3
Copy link

still facing same issue over here, as others have mentioned, seems to only work during market hours

@ValueRaider
Copy link
Collaborator

@KingThutmose3 create a new Issue, follow the instructions

@lguoca
Copy link

lguoca commented May 31, 2023

autodata.py line771 , I fix this line as folllow, work fine
#seconds=self._granularity_to_seconds(granularity, "yahoo") * 1.5 * count+86400
days=int((count*self._granularity_to_seconds(granularity, "yahoo"))/23400)+4

@GreySnowFox
Copy link

hi @ValueRaider you seem like the right man to help me!!! Please!

My error is the same repeating many times:

1 Failed download:
['---']: Exception('%ticker%: No timezone found, symbol may be delisted')
No data available for ---. Skipping...
[100%**] 1 of 1 completed

I have now spent many many hours trying to work this out. I am really hoping you can help me. Here is part of my py script:

Imports

from pandas_datareader import data as pdr
from yahoo_fin import stock_info as si
from pandas import ExcelWriter
import yfinance as yf
import pandas as pd
import datetime
import time
yf.pdr_override()

Variables

tickers = si.tickers_sp500()
tickers = [item.replace(".", "-") for item in tickers] # Yahoo Finance uses dashes instead of dots
index_name = '^GSPC' # S&P 500
start_date = datetime.datetime.now() - datetime.timedelta(days=365)
exportList = pd.DataFrame(columns=['Stock', "RS_Rating", "50 Day MA", "150 Day Ma", "200 Day MA", "52 Week Low", "52 week High"])
returns_multiples = []

Index Returns

index_df = yf.download(index_name, start_date, end_date)
index_df['Percent Change'] = index_df['Adj Close'].pct_change()
index_return = (index_df['Percent Change'] + 1).cumprod()[-1]

Find top 30% performing stocks (relative to the S&P 500)

for ticker in tickers:
# Download historical data as CSV for each stock (makes the process faster)
df = pdr.get_data_yahoo(ticker, start_date, end_date)

if df.empty:
    print(f"No data available for {ticker}. Skipping...")
    continue

df.to_csv(f'{ticker}.csv')

I tried adding the utcnow to the end of the datetime but still has an issue, i have been through all the other related issues that relate to this fix, but cant seem to resolve my specific one. I appreciate any assistance.

@ValueRaider
Copy link
Collaborator

ValueRaider commented Jul 8, 2023

Stop posting new issues in this thread, it's important to follow the new bug report instructions. Locking.

Repository owner locked as off-topic and limited conversation to collaborators Jul 8, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests