Cannot load torchvision despite it being installed
I have installed pytorch and torchvision using:

conda install pytorch-cpu -c pytorch
pip install torchvision


when I try to run the following in spyder:

import torch
import torchvision
import torchvision.transforms as transforms


I get:

Traceback (most recent call last):

  File "&lt;ipython-input-2-0bf25e9dac67&gt;", line 2, in &lt;module&gt;
    import torchvision

  File "C:\Users\lkoefoed\AppData\Local\Continuum\anaconda3\lib\site-package\torchvision\__init__.py", line 2, in &lt;module&gt; 
from torchvision import datasets

  File "C:\Users\lkoefoed\AppData\Local\Continuum\anaconda3\lib\site-packages\torchvision\datasets\__init__.py", line 1, in &lt;module&gt; 
from .lsun import LSUN, LSUNClass

  File "C:\Users\lkoefoed\AppData\Local\Continuum\anaconda3\lib\site-packages\torchvision\datasets\lsun.py", line 2, in &lt;module&gt; 
from PIL import Image

  File "C:\Users\lkoefoed\AppData\Local\Continuum\anaconda3\lib\site-packages\PIL\Image.py", line 56, in &lt;module&gt; 
from . import _imaging as core

ImportError: DLL load failed: The specified module could not be found.


Fixed by running:

conda install pytorch-cpu -c pytorch 
pip install torchvision 


Deleting the PIL and pillow folders in site-packages, then running:

pip install pillow

