pytorch-chatbot icon indicating copy to clipboard operation
pytorch-chatbot copied to clipboard

No module named 'torch'

Open kas2ri opened this issue 3 years ago • 4 comments

I installed PyTorch as you mentioned. i type import torch in the cmd, its works perfectly. but i try to run train.py in vscode terminal, its shows No module named 'torch'. please help me

kas2ri avatar Jul 04 '21 08:07 kas2ri

make sure your VS Code is using the correct environment

patrickloeber avatar Jul 09 '21 07:07 patrickloeber

Probably you have setup a multiple python environment in your local PC. Which eventually create this issue.

Solution: Easy: Please install the pytorch from your VS Code's terminal, that will surely solve your problem. Real-Solution:

  1. Check how many different Python version you have installed on your PC.
  2. Check which Python HOMEPATH is there in your VS Code
  3. Try to change it to the one in which you have installed pytorch.

Happy Torching!!!!!!!!!!

mrunalmania avatar Mar 14 '23 00:03 mrunalmania

make sure your VS Code is using the correct environment

Hello, I am using the correct environment but it's still bringing the same error

ann-shiku avatar Mar 30 '23 06:03 ann-shiku

In vscode, using Ctrl + Shift + P(windows) to choose a proper Python interpreter.

shizhengLi avatar Jul 09 '23 02:07 shizhengLi