nathanielwarner / flightgear-photoscenery

FlightGear - PhotoScenery Edition
GNU General Public License v2.0
21 stars 6 forks source link

ImportError: cannot import name 'UnidentifiedImageError' #3

Closed Megaf closed 3 years ago

Megaf commented 3 years ago

Script worked fine before https://github.com/nathanielwarner/flightgear-photoscenery/commit/9db133e0b9b3293b1c5332c2beeab7b6fa8d37e7

Traceback (most recent call last):
  File "creator.py", line 7, in <module>
    from PIL import Image, UnidentifiedImageError
ImportError: cannot import name 'UnidentifiedImageError' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)

Debian Buster.

Megaf commented 3 years ago

I can "fix" that with

apt install -y python3-pip && python3 -m pip install --upgrade pip && python3 -m pip install --upgrade Pillow

Though I'm quite sure I had Pillow installed with apt already.

nathanielwarner commented 3 years ago

Hi Megaf, The script is written assuming an up-to-date version of Pillow. If your distribution doesn't provide this, the workaround you mentioned (manually installing with pip) is the way to go. Although I would strongly suggest appending --user to your pip commands in order to avoid screwing up your system install of Python. (unless you're in a virtual environment of course)

Megaf commented 3 years ago

Hi Megaf, The script is written assuming an up-to-date version of Pillow. If your distribution doesn't provide this, the workaround you mentioned (manually installing with pip) is the way to go. Although I would strongly suggest appending --user to your pip commands in order to avoid screwing up your system install of Python. (unless you're in a virtual environment of course)

Thanks for the reply and suggestion on the --user! Keep up with the amazing work on this script :)