Closed ChristofNies closed 1 year ago
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?
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:
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)
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
Can a Jupyter user debug the root cause?
Also tried this solution: #359. But it didn't seem to help
I have the same issue. yfinance-0.2.3;
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.
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.
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.
Is this problem only Jupyter + Anaconda?
I only assume this as appears to be common denominator. What is your execution environment?
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.
Could it be the same as #1387 i.e. related to cache tz retrieval?
@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.
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.
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!
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.
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'stzinfo
attribute. I think we're close to a fix, I can smell it.
I think fix is this: replace this line:
with this:
dt_now = pd.Timestamp.utcnow()
Try that and report back
dt_now = pd.Timestamp.utcnow()
it doesn't work
I have the duplicated error “No timezone found, symbol may be delisted”. how to solve it?
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
I have the duplicated error “No timezone found, symbol may be delisted”. how to solve it?
No idea. You have to debug
I think fix is this: replace this line:
with this:
dt_now = pd.Timestamp.utcnow()
Try that and report back
That solved my issue, ty!
@TapeReaderJoe Can you submit a Pull Request? #1084
@TapeReaderJoe Can you submit a Pull Request? #1084
I have solved this issue through replace the main branch by the proxy fixed branch. thx
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
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 I've edited that post with a working link
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.
Surprised no one created a PR for this yet :(, created a PR here: https://github.com/ranaroussi/yfinance/pull/1488
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.
@JoanVendrellC If ta
interferes with latest release, create a new Issue
still facing same issue over here, as others have mentioned, seems to only work during market hours
@KingThutmose3 create a new Issue, follow the instructions
autodata.py line771 , I fix this line as folllow, work fine
days=int((count*self._granularity_to_seconds(granularity, "yahoo"))/23400)+4
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:
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()
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_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]
for ticker in tickers:
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.
Stop posting new issues in this thread, it's important to follow the new bug report instructions. Locking.
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: