Skip to content
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

AttributeError: module 'pandas._libs.properties' has no attribute 'tz' #2118

Open
justjoehere opened this issue Nov 8, 2024 · 2 comments
Open

Comments

@justjoehere
Copy link

Describe bug

Library Versions: yfinance 0.2.48 and pandas 2.2.3
Python 3.12.7

Attempting to get history results in AttributeError: module 'pandas._libs.properties' has no attribute 'tz'

Simple code that reproduces your problem

import yfinance as yf
print(yf.version)

yf.enable_debug_mode()

stock = yf.Ticker('NVDA')

history = stock.history(interval="1d")
print(history)

Debug log

DEBUG Entering history()
DEBUG Entering history()
DEBUG NVDA: Yahoo GET parameters: {'range': '1mo', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG Entering get()
DEBUG Entering _make_request()
DEBUG url=https://query2.finance.yahoo.com/v8/finance/chart/NVDA
DEBUG params={'range': '1mo', 'interval': '1d', 'includePrePost': False, 'events': 'div,splits,capitalGains'}
DEBUG Entering _get_cookie_and_crumb()
DEBUG cookie_mode = 'basic'
DEBUG Entering _get_cookie_and_crumb_basic()
DEBUG loaded persistent cookie
DEBUG reusing cookie
DEBUG crumb = 'UvoFIZQnHbH'
DEBUG Exiting _get_cookie_and_crumb_basic()
DEBUG Exiting _get_cookie_and_crumb()
DEBUG response code=200
DEBUG Exiting _make_request()
DEBUG Exiting get()
DEBUG NVDA: yfinance received OHLC data: 2024-10-09 13:30:00 -> 2024-11-08 21:00:01
DEBUG NVDA: OHLC after cleaning: 2024-10-09 09:30:00-04:00 -> 2024-11-08 16:00:01-05:00

Bad data proof

N/A

yfinance version

0.2.48

Python version

3.12.7

Operating system

Windows 11

@boringbyte
Copy link

@justjoehere , tested with yfinance v0.2.49 and pandas v2.2.3 on python 3.12. Did not run into any issue downloading data. Can you try again with updated yfinance library

@AJAY1684
Copy link

AJAY1684 commented Dec 7, 2024

@justjoehere, Tested with yfinance v0.2.50 and pandas v2.2.2 on python 3.12.8. Didn't run into any issues downloading data. But debug logs are showing in the console. can be turned off by setting yf_logger.setLevel(logging.ERROR) in utils.py file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants