-
-
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
ParserError('Error tokenizing data. ...') #1526
Comments
By the way, I am using Pandas 2.0.1. Many thanks again! :) |
Let's keep the issue thread concise and focused. Install pre-release via PIP then enable debug logging and post output. And post any feedback you have on the logging. |
Ok, ValueRaider. I have installed the pre-release version and enabled debug logging. Pandas is 2.0.1, Python 3.11.2, Windows 10. Input: Output: ERROR
Date A big thank you again, ValueRaider! |
Grab Git branch What do you think of the new logging / error reporting? |
Or, easier option: temporarily downgrade to 0.1.96 |
ValueRaider, many thanks for the solutions! I implemented the easier option (downgrading to 0.1.96), since option 1 was somewhat difficult for me to implement. I do not have Git and installing it seemed somewhat tricky. Anyway, it is running fine now. |
@ValueRaider many thanks again for your help on this issue! just one final question please before I close this issue. Will the fix be implemented in the coming release or is it already implemented in the pre-release? I am new to Github so I am not very familiar with the terminology here... :) |
It's only in The pre-release (aka beta) contains the new logging functionality, that's completely different. |
Hello ValueRaider, I noticed that I need some functions that are not available in 0.1.96. So I installed git and executed the following line: pip install git+https://github.com/ranaroussi/yfinance.git@fix/tz-cache-migrate-error Output was: Collecting git+https://github.com/ranaroussi/yfinance.git@fix/tz-cache-migrate-error × git checkout -q fix/tz-cache-migrate-error did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × git checkout -q fix/tz-cache-migrate-error did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. Obvisouly he could not find the fix/tz-cache-migrate-error. I guess this is because the fix was deleted as written here: So should I stay on 0.1.96? There is no chance for me to use download function of the current release version of yfinance, right? Many thanks in advance again, @ValueRaider ! :) |
I thought you confirmed the issue fixed by downgrading to 0.1.96. Only need to run the fix once: #1526 (comment) |
Yes, the download function is working now with 0.1.96. But there are other functions that 0.1.96 does not include. However, these functions are implemented in the current version. The function I am referring to is whether a ticker has options. This function is not provided in 0.1.96. |
What do you think that means? |
Sorry but I can't follow you... 😅 |
You only need to run the 'bug fix' once and the bug is permanently fixed. Trust me. |
@ValueRaider thanks for the info! Input: Output: 1 Failed download:
Another try: Output: 1 Failed download:
I have no idea what the issue is here... 😅 But many thanks again, @ValueRaider I need patience! ;-) |
I need the stack trace. |
Hi @ValueRaider I enabled debug logging and I am still getting exactly the same output as before: Input: Output: 1 Failed download:
Input: Output: 1 Failed download:
This time, I used the same input two times... Interestingly, the output is different between the two... Many thanks again, @ValueRaider ! :) |
Doesn't look like pre-release. Confirm your yfinance version: |
Good morning @ValueRaider! The yfinance version that I am running at the moment is print(yf.version): 0.2.19b3 I tried to execute again the download function and got the following error messages: First run: Here is the input: The output: Second run: Output: Quick note: Is it possible to restore the fix and to keep it until it is built in the coming release? This would allow me to install and use all upcoming versions of yfinance... Many thanks again, @ValueRaider ! Appreciate your support and thanks for your patience with me! :) |
If you look more carefully, this current error is different to the first. Can you email me the contents of the folder printed by |
... are you serious? I don't have the patience for this. |
Ok you eventually figured it out. Fix by deleting those files. |
A very big thank you, @ValueRaider ! I have some questions though:
Anyway, many thanks for your support and patience again! :) |
@ValueRaider Input: Output: KeyError Traceback (most recent call last) File c:\Users\peter\AppData\Local\Programs\Python\Python311\Lib\site-packages\yfinance\multi.py:178, in download(tickers, start, end, actions, threads, ignore_tz, group_by, auto_adjust, back_adjust, repair, keepna, progress, period, show_errors, interval, prepost, proxy, rounding, timeout) KeyError: 'SAFE WI' |
The problem is the following part: File c:\Users\peter\AppData\Local\Programs\Python\Python311\Lib\site-packages\yfinance\multi.py:178, in download(tickers, start, end, actions, threads, ignore_tz, group_by, auto_adjust, back_adjust, repair, keepna, progress, period, show_errors, interval, prepost, proxy, rounding, timeout) KeyError: 'SAFE WI' The first part is ok... these "error messages" that some symbols might be problably have been delisted are ok... they were always there. |
Questions: read https://github.com/ranaroussi/yfinance#timezone-cache-store. 'SAFE WI': problem should be obvious. If you think |
I re-installed the latest release-version of yfinance and it is running like silk. It is not leading to the bug like the pre-release version! Input: Output: 25 Failed downloads:
There is no more bug like in #1526 (comment)! There has also not been a bug in previous versions! The output simply said that there were a couple of failed downloads but nevertheless, the download was completed and the dataframe was constructed. The pre-release version generates a bug once there is a failed download. Hence, can you please allow future versions of yfinance to continue the download without generating a bug if it fails to download certain symbols? Once again, a very big thank you, @ValueRaider ! |
Me? No. Create a specific Issue and maybe someone can implement. |
Just did: #1537 I hope the issue is clear... Whenever a long list of tickers is passed to yf.download, chances are that some tickers will fail to be downloaded. In this case, yf.download shoould not generate a bug like in the pre-release version 0.2.19b3 but continue its behaviour like in 0.2.18. |
Hello,
I am running Python 3.11.2 and Yfinance 0.2.18.
I am trying to download historical data by executing the following line:
yf.download(tickers="AAPL", start='2021-1-1', auto_adjust=True, threads=True)
I am getting the following output (error):
"- AAPL: ParserError('Error tokenizing data. C error: Expected 2 fields in line 1098, saw 3\n')"
Anyone having the same issue? Many thanks!
The text was updated successfully, but these errors were encountered: