Jupyter Notebook - ModuleNotFoundError

41,547

Open a notebook. Install your packages through the notebook by entering in a notebook cell -

!pip install numpy
!pip install pandas

Then import

Share:
41,547
the_coder
Author by

the_coder

Updated on July 05, 2022

Comments

  • the_coder
    the_coder almost 2 years

    I have Python 3.7 installed on my windows 10 laptop. i installed pandas and numpy a few days ago on my laptop and they worked fine when used in my jupyter notebook by writing import numpy as np and import pandas as pd. But today when i started my jupyter notebook again to practice the same error occurred a quite a few times. ModuleNotFoundError: No module named 'numpy'

    I tried restarting the jupyter kernel many times and then executed the statement again and again but the same error displayed each time.

    I've installed numpy using pip install numpy and pandas using pip install pandas

    i already tried installing pandas and numpy through my jupyter notebook using !pip install numpy and !pip install pandas but the problem remains the same. Check out the below screenshots. Click on the link to view.

    pandas error

    numpy error

    I'm still learning python so can you please help me with this. I don't know what to do.

  • the_coder
    the_coder over 5 years
    i already tried what you said exactly the same but the problem still remains the same. Check my answer above where i am adding a link of two screenshots (one is the numpy error and another one for pandas error after installing it through jupyter notebook)
  • pyeR_biz
    pyeR_biz over 5 years
    Have you set your environment paths?
  • the_coder
    the_coder over 5 years
    No. How can we do that?
  • pyeR_biz
    pyeR_biz over 5 years
  • pyeR_biz
    pyeR_biz over 5 years
  • the_coder
    the_coder over 5 years
    Hey, it worked. I tried following the commands from the above links. Thank You So Much.
  • pyeR_biz
    pyeR_biz over 5 years
    Great job, but you have to become better at using stack overflow. Always search for existing answers first. This one will be most likely marked duplicate
  • Py_minion
    Py_minion over 4 years
    %pip install numpy %pip install pandas Then restart the kernel and execute the cells.
  • Sai Nikhil
    Sai Nikhil about 4 years
    Man, you saved my life. Thank you so much. No other solutions worked. This answer is very underrated. Others, please upvote and show your gratitude if it worked for you.