No module named “Torch”

Try to install PyTorch using pip:

First create a Conda environment using:

conda create -n env_pytorch python=3.6

Activate the environment using:

conda activate env_pytorch

Now install PyTorch using pip:

pip install torchvision 

Note: This will install both torch and torchvision.

Now go to Python shell and import using the command:

import torch
import torchvision

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)