ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
14.89k stars 2.44k forks source link

fetching the data #2117

Closed adnaan-sidd closed 3 days ago

adnaan-sidd commented 1 week ago

Describe bug

Earlier, I can use the yfinance, however since the update, I cannot use it. Earlier, I used to revieve the historical datas using yfinance, however now it won't allow me to do so. I keep getting errors. Have you removed this function?

Simple code that reproduces your problem

import yfinance as yf

Define the forex pairs

forex_pairs = ['EURUSD=X', 'GBPUSD=X', 'USDJPY=X'] # Add more pairs as needed

Fetch the data for the specified forex pairs

forex_data = yf.download(forex_pairs, period='1mo') # You can change the period to '1d', '5d', '1y', etc.

Display the historical data

print(forex_data)

Debug log

(myenv) adnaansidd@Bot:~/realtime/bot$ python3 one.py Traceback (most recent call last): File "/home/adnaansidd/realtime/bot/one.py", line 7, in forex_data = yf.download(forex_pairs, period='1mo') # You can change the period to '1d', '5d', '1y', etc. AttributeError: module 'yfinance' has no attribute 'download'

Bad data proof

No response

yfinance version

0.2.48

Python version

Python 3.10.15

Operating system

Linux (ubuntu 20.04)

BambooOwl commented 3 days ago

you should check again, .download should not be working, try yf.Ticker?

adnaan-sidd commented 3 days ago

Nope tried that still won't work at all

ValueRaider commented 3 days ago

AttributeError: module 'yfinance' has no attribute 'download'

Your install is broken.