当尝试运行肉桂设置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后,我看到了这个错误
发布于 2020-08-01 15:12:30
这是肉桂和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':。
发布于 2020-08-02 10:54:52
如果你对蟒蛇很满意的话。您可以修改/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.pysudo 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()如果您使用的是PIL的当前版本,则不需要检查版本Image.VERSION 1.1.7。
https://askubuntu.com/questions/1230923
复制相似问题