Modulenotfounderror: no module named yfinance

In this article, we will discuss the solutions on how to solve the modulenotfounderror no module named yfinance.

Why the modulenotfounderror: no module named ‘yfinance’ occur?

The modulenotfounderror: no module named ‘yfinance’ occur because the python interpreter cannot find the installed yfinance module in your system. On the other hand, the error also occurs because the yfinance module is already installed yet it is installed in an incorrect path environment.

Also read: Modulenotfounderror: no module named ‘absl’ [SOLVED]

How to solve the modulenotfounderror no module named yfinance?

Time needed: 3 minutes

Here are the solutions to solve the no module named yfinance in Windows, MacOS, Linux, Anaconda, and Jupyter Notebook.

  • Solutions 1: Installation yfinance module in Windows

    Open the command prompt(CMD) in your project root directory. Then type the following command below to install the yfinance in Python 2, Python 3, Py Alias, Server Side, Anaconda.

    Install yfinance For Python 2:
    pip install yfinance

    python 2 Modulenotfounderror no module named yfinance

    In your Python 2: If you don’t have pip in your PATH environment variable. Type the following command below:
    python -m pip install yfinance

    Install yfinance For Python 3:
    pip3 install yfinance

    In your Python 3: If you don’t have pip in your PATH environment variable. Type the following command below:
    python3 -m pip install yfinance

    For Py Alias:
    py -m pip install yfinance

    Install yfinance if you got the server-side error:
    pip install yfinance --user

    If you encountered this error “pip is not recognized as an internal or external command“, you will use this command python -m when you are installing yfinance.

    For Python 2:
    python -m pip install yfinance

    For Python 3:
    python3 -m pip install yfinance

    For Py Alias:
    py -m pip install yfinance

  • Solution 2: Install yfinance for Anaconda:

    The following command to install the yfinance for Anaconda:

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

    After you execute the command above it will show the following output:

    Anaconda Modulenotfounderror no module named yfinance

  • Solution 3: Install yfinance in Jupyter Notebook

    The following command to install the yfinance for Jupyter Notebook:

    pip install yfinance

    After you execute the command above it will show the following output:

    Jupyter Notebook Modulenotfounderror no module named yfinance

Conclusion

To conclude in this article, we already provide the best solutions above to solve the Modulenotfounderror: no module named yfinance when you are encountered this in installing in Windows, Linux, Anaconda, and Jupyter Notebook.

Leave a Comment