twopirllc / pandas-ta

Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 150+ Indicators
https://twopirllc.github.io/pandas-ta/
MIT License
5.42k stars 1.06k forks source link

AttributeError: module 'yfinance' has no attribute 'pdr_override' #853

Open NormPlum opened 3 hours ago

NormPlum commented 3 hours ago

Which version are you running? The lastest version is on Github. Pip is for major releases. 0.3.14b0

Do you have TA Lib also installed in your environment? No.

Have you tried the development version? Did it resolve the issue? Haven't tried.

Describe the bug The following error is seen when trying to use yfinance:

Traceback (most recent call last):
  File "/[SNIP]/trading.py", line 11, in <module>
    df = df.ta.ticker("aapl")
         ^^^^^^^^^^^^^^^^^^^^
  File "/[SNIP]/.local/lib/python3.12/site-packages/pandas_ta/core.py", line 851, in ticker
    df = yf(ticker, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^
  File "/[SNIP]/.local/lib/python3.12/site-packages/pandas_ta/utils/data/yahoofinance.py", line 86, in yf
    yfra.pdr_override()
    ^^^^^^^^^^^^^^^^^
AttributeError: module 'yfinance' has no attribute 'pdr_override'

To Reproduce

import pandas as pd
import pandas_ta as ta

df = pd.DataFrame() # Empty DataFrame
df = df.ta.ticker("aapl")

Expected behavior Not be shown an error.

NormPlum commented 3 hours ago

Ok, I just tried the development version (pip install -U git+https://github.com/twopirllc/pandas-ta.git@development) and that works.

Is there an estimate on when the next release will be? 'Cause yfinance seems to be unusable via pandas-ta until then...