Linux Mint Cinnamon 打开设置时出错(没有名为“PIL”的模块)

Tu4*_*n3r 2 python python-imaging-library linux-mint cinnamon

自从我将 Cinnamon 更新到 5.0.6 后,我无法访问“首选项”下的任何条目,什么也没有发生。当我尝试从 CLI 打开时,出现以下信息:

#> cinnamon-settings
No module named 'PIL'
Run Code Online (Sandbox Code Playgroud)

我搜索了很多,但没有适合我的问题。我知道这是 Python 和 PIL 模块或较新模块 Pillow 的问题,但提供的解决方案都不适合我。

一些信息:


#> python --version
Python 3.8.10

#> /usr/bin/env python
Python 3.8.10 (default, Sep 28 2021, 16:10:42) 

#> pip -V
pip 21.3 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)

#> pip show Pillow
Name: Pillow
Version: 8.4.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
Author: Alex Clark (PIL Fork Author)
Author-email: aclark@python-pillow.org
License: HPND
Location: /home/xxx/.local/lib/python3.8/site-packages
Requires: 
Required-by: image, imageio, img2pdf, matplotlib, ocrmypdf, pikepdf, reportlab, scikit-image


Run Code Online (Sandbox Code Playgroud)

你有什么想法 ?

谢谢

编辑:我在 Cinnamon 5.0.6 变更日志中找到了这个,我认为这就是问题所在

  • cinnamon-settings:从 python 的模块搜索路径中删除 ~/.local 和 /usr/local

小智 12

这是类似的问题和解决方案 https://forums.linuxmint.com/viewtopic.php?t=364028

就我而言,我需要重新安装所有请求的模块

喜欢:

apt-get install --reinstall python3-pil
apt-get reinstall python3-requests
apt-get reinstall python3-six
apt-get reinstall python3-urllib3
Run Code Online (Sandbox Code Playgroud)

现在它可以在 /usr/share/cinnamon/cinnamon-settings/bin/util.py 中没有注释行的情况下工作

  • ``` apt-get install --reinstall python3-pil ``` 帮我解决了这个问题。 (3认同)