I want to install PyTorch version 1.3.0, which can only be installed in python 3.7 or less. I have python 3.9. So I created a different venv that can run according to python 3.7 (How do I install a package for different Python versions in Anaconda?).
After installing PyTorch 1.3.0 using the command conda install pytorch==1.3.0
, When I try to access the library in my Python file it gives an error ModuleNotFoundError: No module named 'torch'
Asked
Active
Viewed 174 times
0

Mauj Mishra
- 133
- 1
- 12
-
Did you try `conda activate py37` or whatever your environment name is for python 3.7 and then installing? – not_speshal Oct 28 '21 at 18:01
-
Yes, The install was successfull. But I cant access the module even after installing – Mauj Mishra Oct 28 '21 at 18:02
-
Where are you running the Python file from? Are you in the right environment there too? – not_speshal Oct 28 '21 at 18:04
-
I am using PyCharm. What do you mean by the right environment? – Mauj Mishra Oct 28 '21 at 18:05
-
[Configure a Python interpreter](https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html) in pycharm – It_is_Chris Oct 28 '21 at 18:09
-
So, should I set my python interpreter to Python3.7? – Mauj Mishra Oct 28 '21 at 18:11
-
Does this answer your question? [How to set default PyCharm interpreter?](https://stackoverflow.com/questions/19679150/how-to-set-default-pycharm-interpreter) – Pedro Maia Oct 28 '21 at 18:13
-
No, I know how to change the interpreter. I want to know how to solve the ModuleNotFoundError – Mauj Mishra Oct 28 '21 at 18:16
-
1By changing the interpreter :/ – not_speshal Oct 28 '21 at 18:25