Home > other >  ModuleNotFoundError: No module named 'yfinance' - Importing Yahoo finance & Financials to
ModuleNotFoundError: No module named 'yfinance' - Importing Yahoo finance & Financials to

Time:02-24

I'm using Mac OS and receiving an error when doing the following:

import pandas as pd
import yfinance as yf
from yahoofinancials import YahooFinancials

ModuleNotFoundError: No module named 'yfinance'

I've checked pip is installed to the latest version & I've done pip list and yfinance is in there.

I have also checked with:

pip show yfinance
Name: yfinance
Version: 0.1.70
Summary: Download market data from Yahoo! Finance API
Home-page: https://github.com/ranaroussi/yfinance
Author: Ran Aroussi
Author-email: [email protected]
License: Apache
Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages
Requires: lxml, multitasking, numpy, pandas, requests
Required-by: 
MacBook-Air:~ User$ 

So it's installed and its path is that of Python3 the latest python.

I'd really appreciate any suggestions!

Thanks

[EDIT]

I'm running Spyder from the default Spyder environment.

CodePudding user response:

To install yfinance package with pip:

pip install -i https://pypi.anaconda.org/ranaroussi/simple finance

To install yfinance package with conda:

conda install -c ranaroussi yfinance

CodePudding user response:

put this one at bigining

!pip install yfinance

  • Related