问题

最近我的Gentoo Linux系统升级后,经常会出现如下报错:

text
1python-exec: Invalid impl in /etc/python-exec/python-exec.conf: python3.6

究其原因,是因为python升级了新版本(3.8或3.9),而删除了旧版(3.6),但因为配置的版本选择器并没有相应更新,所以有此信息提示。

解决方法

解决方法如下(即使用eselect python clean):

sh
1# eselect python list
2Available Python interpreters, in order of preference:
3  [1]   python3.9
4  [2]   python3.7 (uninstalled)
5  [3]   python3.6 (uninstalled)
6  [4]   python3.8 (fallback)
sh
1# eselect python cleanup
sh
1# eselect python update
2Switching to python3.9
sh
1# eselect python list
2Available Python interpreters, in order of preference:
3  [1]   python3.9
4  [2]   python3.8 (fallback)

其他

若本地没有安装eselect-python,则可能在上述修复过程中,会出现如下提示:

text
1# eselect python
2!!! Error: Can't load module python
3exiting

可以通过如下命令,安装相应软件包,进行解决:

sh
1emerge -av eselect-python

参考