I encountered the same problem then I updated my yfinance using the following command pip install --upgrade yfinance to 0.2.54 and it worked
pip install --upgrade yfinance