patrickloeber / pytorch-chatbot

Simple chatbot implementation with PyTorch.
MIT License
420 stars 334 forks source link

No module named 'torch' #7

Open kas2ri opened 3 years ago

kas2ri commented 3 years ago

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

patrickloeber commented 3 years ago

make sure your VS Code is using the correct environment

mrunalmania commented 1 year ago

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!!!!!!!!!!

ann-shiku commented 1 year ago

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

shizhengLi commented 1 year ago

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