PyTorch ModuleNotFoundError: No module named torch

Error while building PyTorch project:

Traceback (most recent call last):
  File ModuleNotFoundError: No module named 'torch'

The solution is to install torch package. Run the below command in the terminal pointing to your project:

pip install torch

Output will be like this from the terminal:

Collecting torch
  Downloading torch-1.12.1-cp310-none-macosx_11_0_arm64.whl (49.1 MB)
     |████████████████████████████████| 49.1 MB 10.5 MB/s            
Collecting typing-extensions
  Using cached typing_extensions-4.3.0-py3-none-any.whl (25 kB)
Installing collected packages: typing-extensions, torch
Successfully installed torch-1.12.1 typing-extensions-4.3.0

Build the project again and the issue will be fixed.