-
Notifications
You must be signed in to change notification settings - Fork 5
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
Why can't the newly downloaded data run? It reports an error when I change the time for downloading the data. #1
Comments
Noticed in your error message that it encounters a "ProxyError", it's mostly caused by your proxy setting. Double check your proxy settings and make sure u have ur proxy settings correctly in your code and you are able to access yahoo finance. If you dont need the proxy or you have direct access to yfinance, you can simply remove the proxy parameter in the yf.download function in file "process_stock_data.py" line 91, the codes are given below. data = yf.download(ticker, start=start_date, end=end_date, proxy="http://127.0.0.1:7890")
# change this to
data = yf.download(ticker, start=start_date, end=end_date) |
Thank you for your clarification, but I am still encountering issues with data download. 1 Failed download: 1 Failed download: |
What operating system are you using? I have tried to call the yfinance API to download on a Linux system, but it failed. The same code is successful on Windows. If you are operating in Linux or WSL, I suggest you switch to Windows. In addition, you may need to check whether your proxy settings are correct, especially whether you have set the relevant proxy environment variables in the terminal. I have to admit that it is really difficult to use yfinance in China. I also encountered many errors at that time. I suggest you look for similar situations in the issues of the yfinance official repository. . |
data = yf.download(ticker, start=start_date, end=end_date, proxy="http://127.0.0.1:7890") 处理 AAPL 中... 1 Failed download: 1 Failed download: 我关了VPN的报错是: 开始下载和处理股票数据... 1 Failed download: 但我写了一个只单纯下载数据的代码 import yfinance as yf 定义股票代码、开始日期和结束日期ticker = "MSFT" # 股票代码,例如苹果公司的股票代码是"AAPL" 下载股票数据stock_data = yf.download(ticker, start=start_date, end=end_date, proxy="http://127.0.0.1:7890") 显示数据print(stock_data) 关了VPN是正常运行并能显示出数据 [1006 rows x 6 columns] 但打开VPN的报错是: 1 Failed download: 我尝试了很多方法,还是不知道问题在哪,您能抽空帮我解决一下吗,万分感激 |
开始下载和处理股票数据...
处理 AAPL 中...
Failed to get ticker 'AAPL' reason: HTTPSConnectionPool(host='query1.finance.yahoo.com', port=443): Max retries exceeded with url: /v1/test/getcrumb (Caused by ProxyError('Unable to connect to proxy', FileNotFoundError(2, 'No such file or directory')))
处理 AAPL 时出错: 'Index' object has no attribute 'year'
And this issue occurs for all stocks.Adjusting the end time, whether forwards or backwards, and even restoring it to the original time, results in the same issue. Why is this happening?
The text was updated successfully, but these errors were encountered: