Hello,
Can you help me? I tried almost all that I could find on the web but still get an error message.
Basically, I created a new conda environment and installed pytorch in a computer cluster.
It seems correctly installed but I still get the error message "ModuleNotFoundError: No module named ‘torch.’
(env_pytorch) [asidasi@hpcc ~]$
(env_pytorch) [asidasi@hpcc ~]$ python -c “import torch”
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘torch’
(env_pytorch) [asidasi@hpcc ~]$
(env_pytorch) [asidasi@hpcc ~]$
(env_pytorch) [asidasi@hpcc ~]$ conda list | grep torch
packages in environment at /home/asidasi/.conda/envs/env_pytorch:
Thanks for a quick reply!
Yes, I already activated my conda environment (env_pytorch), as you can see in my post.
I also double-checked which python I am using. I am using the correct python in my env.
can you check by typing “which python” in the terminal? That’ll tell what python executable it’s using. Also, if you’re submitting a job via a job scheduler it might be changing the environment post-launch. For example with PBS you need to state the environment at the beginning of your .py script.