<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">Pillow just released 7.0.0. This breaks torchvision.transforms as the import fails:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;examples/mnist.py&quot;, line 5, in &lt;module&gt;
    from torchvision.transforms import (
  File &quot;/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/__init__.py&quot;, line 4, in &lt;module&gt;
    from torchvision import datasets
  File &quot;/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/datasets/__init__.py&quot;, line 9, in &lt;module&gt;
    from .fakedata import FakeData
  File &quot;/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/datasets/fakedata.py&quot;, line 3, in &lt;module&gt;
    from .. import transforms
  File &quot;/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/transforms/__init__.py&quot;, line 1, in &lt;module&gt;
    from .transforms import *
  File &quot;/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/transforms/transforms.py&quot;, line 17, in &lt;module&gt;
    from . import functional as F
  File &quot;/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/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'
"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "examples/mnist.py", line 5, in &lt;module&gt;
    from torchvision.transforms import (
  File "/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/__init__.py", line 4, in &lt;module&gt;
    from torchvision import datasets
  File "/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/datasets/__init__.py", line 9, in &lt;module&gt;
    from .fakedata import FakeData
  File "/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/datasets/fakedata.py", line 3, in &lt;module&gt;
    from .. import transforms
  File "/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/transforms/__init__.py", line 1, in &lt;module&gt;
    from .transforms import *
  File "/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 17, in &lt;module&gt;
    from . import functional as F
  File "/home/felix/.local/share/virtualenvs/repro-Cd9xy9KO/lib/python3.6/site-packages/torchvision/transforms/functional.py", line 5, in &lt;module&gt;
    from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION
ImportError: cannot import name 'PILLOW_VERSION'

</code></pre></div>
<p dir="auto"><a href="https://github.com/python-pillow/Pillow/releases">https://github.com/python-pillow/Pillow/releases</a></p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">run<br>
<code class="notranslate">from torchvision.transforms import Compose</code></p>
<h2 dir="auto">Environment</h2>
<p dir="auto">torch==1.3.1<br>
torchvision==0.4.2<br>
torchvision==7.0.0</p>
<h2 dir="auto">Fix</h2>
<p dir="auto">I pinned pillow to version 6.2.2. After this the import works again</p>
<p dir="auto">Hi, it looks like Pillow released version 7.0.0 so I can no longer import torchvision without getting this error: <code class="notranslate">ImportError: cannot import name 'PILLOW_VERSION' from 'PIL'</code></p>
<p dir="auto">Pinning to Pillow 6.2.1 fixes the issue.</p>
<p dir="auto">I see that you fixed this for a future torchvision release (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="509141756" data-permission-text="Title is private" data-url="https://github.com/pytorch/vision/issues/1501" data-hovercard-type="pull_request" data-hovercard-url="/pytorch/vision/pull/1501/hovercard" href="https://github.com/pytorch/vision/pull/1501">#1501</a>). Do you know when this will be released? If it will be awhile, could the version of Pillow be pinned to be less than 7.0.0 in the meantime?</p>
<p dir="auto">Thanks.</p>
<p dir="auto">Versions:<br>
torch: 1.3.1<br>
torchvision: 0.4.2<br>
Pillow: 7.0.0</p>