Unable to install pillow 6.2.1 in conda
After upgrading pytorch / torch-vision the following error occurs:
python -c &quot;import torch ; import torchvision as tv; print(torch.__version__, tv.__version__)
&gt; &quot;
Traceback (most recent call last):
  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/home/pointr/anaconda3/lib/python3.7/site-packages/torchvision/__init__.py&quot;, line 4, in &lt;module&gt;
    from torchvision import datasets
  File &quot;/home/pointr/anaconda3/lib/python3.7/site-packages/torchvision/datasets/__init__.py&quot;, line 9, in &lt;module&gt;
    from .fakedata import FakeData
  File &quot;/home/pointr/anaconda3/lib/python3.7/site-packages/torchvision/datasets/fakedata.py&quot;, line 3, in &lt;module&gt;
    from .. import transforms
  File &quot;/home/pointr/anaconda3/lib/python3.7/site-packages/torchvision/transforms/__init__.py&quot;, line 1, in &lt;module&gt;
    from .transforms import *
  File &quot;/home/pointr/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py&quot;, line 17, in &lt;module&gt;
    from . import functional as F
  File &quot;/home/pointr/anaconda3/lib/python3.7/site-packages/torchvision/transforms/functional.py&quot;, line 5, in &lt;module&gt;
    from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION
ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' (/home/pointr/anaconda3/lib/python3.7/site-packages/PIL/__init__.py)

This has been noted as due to an incompatibility between conda and pytorch 7.0.0  https://github.com/pytorch/vision/issues/1712 . So  I need to downgrade to pillow 6.2.1:
The command posted to do this is:  conda install pillow=6.2.1 -y
However that is failing:
 (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: | 

That is hanging.  So now what ?   The workaround needs itself a workaround ..  Is conda broken for torchvision now?   The primary reason I am using conda in the first place is torch / torchvision ..
Update Conda tried to resolve conflicts. After 20 minutes of this it was 13% done. Ridiculous. This is a 2020 core i7 mini-tower. No sane program takes more than low double digits seconds to resolve dependencies.  I finally killed it.  I am going to try the suggestion to do directly from pip:
pip install Pillow==6.2.1 

OK - that is hanging ..  I am going to uninstall pillow and reinstall it with that version.
Another update  @erip has recommended conda install -c conda-forge pillow=6.2.1 - so here we go:
conda install -c conda-forge pillow=6.2.1
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: \

I will let the dust settle on that one but looking quite unlikely.

The only thing that worked for me is to uninstall /  reinstall conda
https://docs.anaconda.com/anaconda/install/uninstall/
https://docs.conda.io/en/latest/miniconda.html
And here are the versions conda elected to install:
(base) pointr@alienware:~/anaconda3$ python -c &quot;import cv2; import PIL;print('cv2: ' + cv2.__version__); print('PIL: ' + PIL.__version__)&quot;

cv2: 4.1.0
PIL: 7.1.2

(base) pointr@alienware:~/anaconda3$ python -c &quot;import torch ; import torchvision as tv; print('torch:' + torch.__version__); print('torchvision: ' + tv.__version__)&quot;

torch:1.3.1
torchvision: 0.4.2

