To Fix ModuleNotFoundError: No module named ‘torch’ Error just Try this commands. To solve this error just add the below one at the very top of your program import torch And try this. import sys print(sys.executable)