Skip to content

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

@victoria-n-w

Description

@victoria-n-w

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions