При попытке запустить cinnamon-settings python2 я вижу следующую ошибку:
hutber@hutber:~$ cinnamon-settings python2
Traceback (most recent call last):
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 619, in <module>
window = MainWindow()
File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 247, in __init__
for module in modules:
File "/usr/share/cinnamon/cinnamon-settings/modules/cs_backgrounds.py", line 5, in <module>
import imtools
File "/usr/share/cinnamon/cinnamon-settings/bin/imtools.py", line 623, in <module>
if Image.VERSION == '1.1.7':
AttributeError: module 'PIL.Image' has no attribute 'VERSION'
Я видел эту ошибку после установки pip3 install streamdeck_ui --user install
Это известная проблема с версиями между cinnamon и pillow >= 6.0.0
. Вы можете найти больше информации здесь. Как сказал предыдущий комментатор, вы можете найти ошибку в /usr/share/cinnamon/cinnamon-settings/bin/imtools.py
. Однако изменение Image.VERSION
на PIL.VERSION
не решит проблему для pillow >= 7.0.0
. Вместо этого вы должны изменить строку на if Image.__version__ == '1.1.7':
.
Если вам комфортно с python. Вы можете изменить /usr/share/cinnamon/cinnamon-settings/bin/imtools.py
.
sudo cp /usr/share/cinnamon/cinnamon-settings/bin/imtools.py /usr/share/cinnamon/cinnamon-settings/bin/imtools.py.bk
/usr/share/cinnamon/cinnamon-settings/bin/imtools.py
с помощью nanosudo nano /usr/share/cinnamon/cinnamon-settings/bin/imtools.py
До:
if Image.VERSION == '1.1.7':
def split(image):
"""Work around for bug in Pil 1.1.7
:param image: input image
:type image: PIL image object
:returns: the different color bands of the image (eg R, G, B)
:rtype: tuple
"""
image.load()
return image.split()
else:
def split(image):
"""Work around for bug in Pil 1.1.7
:param image: input image
:type image: PIL image object
:returns: the different color bands of the image (eg R, G, B)
:rtype: tuple
"""
return image.split()
После:
def split(image):
"""Work around for bug in Pil 1.1.7
:param image: input image
:type image: PIL image object
:returns: the different color bands of the image (eg R, G, B)
:rtype: tuple
"""
return image.split()
Проверка версии Image.VERSION 1.1.7 не требуется, если вы используете текущую версию PIL.