I'm trying to solve this Error:
ModuleNotFoundError: No module named 'torch'
I did the installation of Pytorch using this command:
conda install pytorch -c pytorch
but when I import torch I got the message above.
Asked
Active
Viewed 970 times
0
Berriel
- 11,226
- 4
- 37
- 59
Eylul Mood
- 13
- 1
-
3Does this answer your question? [ImportError: No module named 'Tkinter'](https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter) – crypthusiast0 Jun 09 '21 at 20:40
-
What is the output of `which python`? Or `pyhon3`, whatever you used to run python. – Berriel Jun 09 '21 at 21:25
1 Answers
0
You might be on another conda environment. try:
conda env list
and find the environment that you have installed pytorch on. then use:
conda activate NAME_OF_YOUR_ENV
to swtich to that environment and run your program there.
Soroush
- 56
- 1
- 5