Search code examples
pythonjupyter-notebookpytorch

Jupyter notebook No module named 'torch' even if I have installed torch


I was working with jupyter notebook, using !pip list I'm sure I have selected the correct environment, yet jupyter notebook still reports No module named 'torch'.

I have also tried import torch in command line and it worked well. How to fix this problem? enter image description here


Solution

  • Solved!

    pip install jupyter in terminal and restart jupyter notebook will fix this problem.