opencv_transforms icon indicating copy to clipboard operation
opencv_transforms copied to clipboard

ImportError: cannot import name 'PILLOW_VERSION' from 'PIL'

Open victoria-n-w opened this issue 5 years ago • 0 comments

when I try to use the package: from opencv_transforms import transforms I get an error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-71-d4430fa4d55e> in <module>
----> 1 from opencv_transforms import transforms

~/.local/lib/python3.8/site-packages/opencv_transforms/transforms.py in <module>
     16 # import opencv_functional as F
     17 import cv2
---> 18 from . import functional as F
     19 
     20 __all__ = [

~/.local/lib/python3.8/site-packages/opencv_transforms/functional.py in <module>
      2 import math
      3 import random
----> 4 from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION
      5 try:
      6     import accimage

ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' (/usr/lib64/python3.8/site-packages/PIL/__init__.py)

I've installed the package by: pip install --user opencv_transforms I have OpenCV package installed, as well as PIL.

According to Pillow documentation PILLOW_VERSION has been removed, and one is supposed to use __version__ now. https://pillow.readthedocs.io/en/stable/releasenotes/7.0.0.html#pillow-version-constant

victoria-n-w avatar Oct 15 '20 14:10 victoria-n-w