I installed pytorch via
conda install pytorch-cpu torchvision-cpu -c pytorch
And I also tried
pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp36-cp36m-win_amd64.whl
pip3 install torchvision
Both installed successfully!
But, it only works in jupiter notebook. Whenever I try to execute a script from the console, I get the error message:
No module named “torch”
How can I fix this?
Kenil Vasani
Try to install PyTorch using pip:
First create a Conda environment using:
Activate the environment using:
Now install PyTorch using pip:
Note: This will install both torch and torchvision.
Now go to Python shell and import using the command: