Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compatibilty with Python 3.10.2 #940

Closed
TheRobinLu opened this issue Jan 24, 2022 · 3 comments
Closed

Compatibilty with Python 3.10.2 #940

TheRobinLu opened this issue Jan 24, 2022 · 3 comments

Comments

@TheRobinLu
Copy link

Just upgrade Python to 3.10.02, when downloaded data, got following error.
yf.download('AMD', interval="1d", start="2021-01-11", group_by="ticker")

Exception in thread Thread-1 (_run_via_pool):
Traceback (most recent call last):
File "C:\Users\lurob\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\lurob\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self._target(*self._args, **self.kwargs)
File "E:\Project\Python\Test310\venv\lib\site-packages\multitasking_init
.py", line 104, in _run_via_pool
return callee(*args, **kwargs)
File "E:\Project\Python\Test310\venv\lib\site-packages\yfinance\multi.py", line 188, in _download_one_threaded
data = _download_one(ticker, start, end, auto_adjust, back_adjust,
File "E:\Project\Python\Test310\venv\lib\site-packages\yfinance\multi.py", line 202, in _download_one
return Ticker(ticker).history(period=period, interval=interval,
File "E:\Project\Python\Test310\venv\lib\site-packages\yfinance\base.py", line 295, in history
df.index = df.index.tz_localize("UTC").tz_convert(
AttributeError: 'Index' object has no attribute 'tz_localize'

any advise?

@moshfrid
Copy link
Contributor

moshfrid commented Jan 24, 2022

The issue isn't python, it's pandas 1.4, duplicate of #937

@aaronweewee
Copy link

This is a problem with python 3.10 as well. When I downgraded Pandas to 1.3.5 it still had the same error. Downgrading both python and pandas solved it

@ValueRaider
Copy link
Collaborator

This was fixed soon after reporting: #937 (comment)

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

No branches or pull requests

4 participants