Ubuntu cinnamon桌面setting出错解决

Creative Commons
本作品采用知识共享署名

本文说明cinnamon-setting出错的处理。

现象

ubuntu上安装了cinnamon桌面,升级 pillow >= 6.0.0 in python后,点击设置无法显示设置菜单

检查

在console中执行cinnamon-settings看见下面错误

1
2
3
4
5
6
7
8
9
10
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'

解决

修改文件/usr/share/cinnamon/cinnamon-settings/bin/imtools.py

1
if Image.VERSION == '1.1.7':

改为

1
if Image.__version__ == '1.1.7':

执行cinnamon-settings恢复正常