Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'torch' #7

Open
kas2ri opened this issue Jul 4, 2021 · 4 comments
Open

No module named 'torch' #7

kas2ri opened this issue Jul 4, 2021 · 4 comments

Comments

@kas2ri
Copy link

kas2ri commented Jul 4, 2021

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
Copy link
Owner

make sure your VS Code is using the correct environment

@mrunalmania
Copy link

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
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants