oduleNotFoundError: No module named 'torchvision'


(Matt) #1

Hi all,

I’ve just installed:

  1. The latest version of anaconda;
  2. Pytorch (based on the attached screen shot of specs); and
  3. I’m running CUDA 9.2, Python 3.7, Windows 10.

I’ve also checked in my “snowflakes” environment (via anaconda prompt) that pip3 & tourchvision are on the list.

Problem frame | When I open Juypter and run:

from torchvision import transforms

I get this error:

ModuleNotFoundError: No module named ‘torchvision’

Can someone please advise why this is the case and how to corrrect, because, I can’t use torchvision for a project I’m working on.

PS: When using Anaconda Navigator - I’ve gone to my environment, and looked for torchvision (in the search packages box). In Anaconda there are no packages called torchvision. So, why would PyTorch recommend it’s install (see screen shot above) if there is no PyTorch (or torchvision, etc) package/s in anaconda?


(Jaya Krishna Mandivarapu) #2

I understand your frustaion sometimes it happens due conda environment not successfully getting activating.

But here one solution to this
Install it from the jupyter notebook itself
SEE THE SCREENSHOT


(Matt) #3

Many thanks for your reply.

I’ve run: !pip3 install torchvision

Though this is the error I got:


(Jaya Krishna Mandivarapu) #5

just try running only pip install torchvision


(Matt) #6

Many thanks,

This is what I got:


(Matt) #7

And this if I drop the !


(Jaya Krishna Mandivarapu) #8

type in your system search bar “anaconda navigator” then launch the “anaconda command prompt” and run those commands

and before this just type “conda” in the windows cmd just to double check that conda is active by default or else need to add the path variable.