question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pillow 5.1 is broken on OS X

See original GitHub issue

When installing torch and torchvision in a clean virtualenv with python3.6 and the corresponding pip on OS X

import torchvision

leads to

torch-venv/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so, 2): Symbol not found: _clock_gettime
torch-venv/lib/python3.6/site-packages/PIL/.dylibs/liblzma.5.dylib (which was built for Mac OS X 10.12)
  Expected in: /usr/lib/libSystem.B.dylib

This is a known bug see Pillow Issue 3068

As a pytorch user it can be fixed by specifying the Pillow version in your requirements.txt

Pillow!=5.1.0
torch
torchvision

The setup.py should get updated with something like:

install_requires=['Pillow != 5.1.0 ; platform_system = "Darwin"']

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
hugovkcommented, Jan 3, 2020

@dharmeshkakadia That’s a duplicate of https://github.com/pytorch/vision/issues/1712:

We will be releasing a new version of PyTorch and torchvision early next week, so this should be soon fixed.

0reactions
dharmeshkakadiacommented, Jan 2, 2020

@vfdev-5 I can reproduce with the exact same commands you posted. Is there a suggestion on how to fix it? Happy to provide more debugging info if needed as well.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/dharmesh/code/pytorch-CycleGAN-and-pix2pix/venv/lib/python3.6/site-packages/torchvision/__init__.py", line 4, in <module>
    from torchvision import datasets
  File "/Users/dharmesh/code/pytorch-CycleGAN-and-pix2pix/venv/lib/python3.6/site-packages/torchvision/datasets/__init__.py", line 9, in <module>
    from .fakedata import FakeData
  File "/Users/dharmesh/code/pytorch-CycleGAN-and-pix2pix/venv/lib/python3.6/site-packages/torchvision/datasets/fakedata.py", line 3, in <module>
    from .. import transforms
  File "/Users/dharmesh/code/pytorch-CycleGAN-and-pix2pix/venv/lib/python3.6/site-packages/torchvision/transforms/__init__.py", line 1, in <module>
    from .transforms import *
  File "/Users/dharmesh/code/pytorch-CycleGAN-and-pix2pix/venv/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 17, in <module>
    from . import functional as F
  File "/Users/dharmesh/code/pytorch-CycleGAN-and-pix2pix/venv/lib/python3.6/site-packages/torchvision/transforms/functional.py", line 5, in <module>
    from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION
ImportError: cannot import name 'PILLOW_VERSION'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is pip installing Pillow for OS X 10.12, when I have OS X ...
This is a bug in the latest Pillow 5.1.0 release. It was caused by upgrading Xcode from version 8 to 9.2 for building...
Read more >
Error installing 5.1.2 on macOS 10.14 - Plone Community
I've been using Unified Installer on MacOS Mojave. ... I managed to install pillow, but I'm still getting the same error message:
Read more >
Pillow 2.5.3 - PyPI
+ Fixed potential crash in ImageFilter for small target images (reported by Zac Burns and Daniel Fetchinson). + Use BMP instead of JPEG...
Read more >
How To Fix “App is Damaged Can't Be Opened” Error Message
App is Damaged Can't Be Opened” or "App is damaged and can't be opened. You should move it the the Trash." error messages...
Read more >
Unreal Engine 5.1 Release Notes
To build the Rosetta version you need to change the target device to My Mac (Rosetta). Xcode Rosetta Option. Note that Marketplace plugins...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found