No module named 'torch'

Hello. I am working on the anaconda base environment. When trying to execute these commands import torch or import torch.nn as nn in Jupyter or Anaconda I get a message that says: ModuleNotFoundError: No module named ‘torch’.
How do I solve that without changing environment?

Additional data:

  • Anaconda Navigator 2.4.0
  • Jupyter 6.5.4
  • Spyder 5.4.3
  • Pytorch 2.0.0

You would need to install PyTorch into the same environment used by Jupyter.

It is installed in the base environment but the problem continues.