gedit插件错误插件加载程序“python3”未找到

2024-10-01 09:23:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在ubuntu 14.04LTS上的gedit 3.10.4中添加一些插件,当我试图在gedit中激活这些插件时出现了一些错误:

(gedit:20686): libpeas-WARNING **: Error initializing Python Plugin Loader: PyGObject initialization failed ImportError: could not import gobject (error was: ImportError("No module named 'gi'",))

(gedit:20686): libpeas-WARNING **: Please check the installation of all the Python related packages required by libpeas and try again

(gedit:20686): libpeas-WARNING **: Loader 'python3' is not a valid PeasPluginLoader instance

(gedit:20686): libpeas-WARNING **: Could not find loader 'python3' for plugin 'bracketcompletion'

我知道了,在ged上

plugin loader 'python3' was not found

有人知道问题从何而来吗?在


Tags: the插件ubuntu错误notloaderpluginpython3
3条回答

我在另一个插件(reST)上也出现了同样的错误。导致这个错误的问题是,当一个virtual environment处于活动状态时,我从命令行运行它。因此Python3没有使用(并找到)系统库。在

解决方案:我从GUI正常运行gedit(或者在终端中停用virtualenv之后),编辑器和插件加载得很好。再次检查是否有类似的原因。在

否则,您可能真的需要检查错误消息中的内容:是否安装了libpeas所需的所有“相关包”。有关信任,请参阅包libpeas-1.0-0的详细信息。在

这是一个gedit错误,请参见https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/859089

作为解决方法,在/usr/lib/gedit/plugin中搜索插件文件(例如bracketcompletion.plugin),并将Loader=python3更改为Loader=python

不幸的是,这个解决方法doesn't work for all the plugins。在

添加到@Railslide的答案:

  1. /usr/lib/gedit/plugin中搜索插件文件(例如bracketcompletion.plugin),并将Loader=python3更改为Loader=python

  2. 如果仍然返回错误-可能是因为它与python3不匹配语法:使用命令^{},如下所示:

    cd python_directory/
    sudo 2to3 -f all -w *
    

例如,对于gedit-latex-plugin。。。在

^{pr2}$

然后通过将python2.x代码替换为python3代码来修复插件

相关

相关问题 更多 >