我该如何解决“无法加载插件“外部工具”。发生错误:在GEdit中找不到插件加载器“ python 3”)的错误?

随便的人

我使用的是预装Ubuntu 20.04.1的GEdit版本3.36.2。我想启用GEdit的“外部工具”插件,但无法启用

单击“外部工具”选项时,出现get符号。

Gedit偏好设置

当我关闭GEdit并重新打开它时,该选项已关闭。

Gedit偏好设置

如果启用它,我将再次获得相同的⛔符号。

如何解决此问题?


Edit 1:
gir1.2-gtksource-3.0 was not installed when I asked this question. After jokerdino's suggestion in the Ask Ubuntu General Room, I installed gir1.2-gtksource-3.0 using this command: sudo apt install gir1.2-gtksource-3.0.

I noticed an error message after installing gir1.2-gtksource-3.0.

gedit中的错误消息

The plugin "External Tools" could not be loaded
An error occured: Plugin loader "python 3" was not found

I am not sure if I could see this error message before installing gir1.2-gtksource-3.0. Maybe I didn't place the mouse pointer on the symbol (for few seconds) the first time when I noticed the symbol or maybe it could be some other reason. I don't know.

jokerdino suggested me to open gedit from terminal and check if I got any specific error while turning on External Tools. I did get an error in the terminal.

** (gedit:14693): WARNING **: 20:21:59.976: Error initializing Python Plugin Loader: PyGObject initialization failed
ImportError: could not import gobject (error was: ModuleNotFoundError("No module named 'gi'"))

** (gedit:14693): WARNING **: 20:21:59.976: Please check the installation of all the Python related packages required by libpeas and try again

(gedit:14693): libpeas-WARNING **: 20:21:59.976: Loader 'python3' is not a valid PeasPluginLoader instance

I guess Python 3.8.2 was pre-installed with my Ubuntu installation. I wanted to upgrade to Python 3.8.3. So I followed the instructions mentioned in this website Install Python 3.8.3 in Ubuntu 20.04 LTS - TechPiezo.
At the end of the article, two suggestions were given. First is to replace (or overwrite) already installed version 3.8.2 of Python; second is to install Python v3.8.3 alongside the Python v3.8.2. I followed the first option.

Kulfy

You must and should rollback to default Python version, i.e., 3.8.2 in 20.04 since there are some libraries which are required by some packages installed in the system only for the default version of Python that may not be available or compatible with other versions. Since you've installed Python 3.8.3 from source, the files were copied in /usr/local/ and /usr/local/bin/python3 is created which a symlink, a.k.a, symbolic link or soft link, of /usr/local/bin/python3.8.

The default value of PATH contains /usr/local/bin before /usr/bin, thus given priority and the reason behind invoking Python 3.8.3 instead of 3.8.2 whenever python3 or python3.8 is called (since default Python is installed in /usr/bin).

To revert back to the default python3 won't take much time for you. You have 3 options to revert back.

  1. Removing the symlink: Just delete /usr/local/bin/python3. Yes that's it.

  2. Recreate symlink: You can make /usr/local/bin/python3 to point to /usr/bin/python3.8 or /usr/bin/python3 (which is already a symlink to /usr/bin/python3.8 as per your message in general room).

    To recreate symlink, use ln with s and f options, i.e.,

    sudo ln -sf /usr/bin/python3.8 /usr/local/bin/python3 # You may replace /usr/bin/python3.8 with /usr/bin/python3 as explained above
    
  3. Giving /usr/bin priority (overkill): Edit /etc/environment and place /usr/bin before /usr/local/bin.

    Warning!!! You should handle /etc/environment with care. Don't touch or do anything unless you know what you're doing.

    Alternatively, you can place PATH="/usr/bin:$PATH" in /.profile.

    完成后,注销并重新登录以进行更改。

由于您已经从源代码安装了Python 3.8.3,因此您需要手动删除文件,因为Python不提供的uninstall选项make要删除它们,请运行:

# From /usr/local/bin
cd /usr/local/bin
sudo rm 2to3 2to3-3.8 easy_install-3.8 idle3 idle3.8 pip3 pip3.8 pydoc3 pydoc3.8 python3 python3.8 python3.8-config python3-config
# From /usr/local/include
sudo rm -r /usr/local/include/python3.8
# From /usr/local/lib
cd /usr/local/lib
sudo rm -r libpython3.8.a pkgconfig python3.8
# From /usr/local/man/man1
cd /usr/local/man/man1
sudo rm -r python3.1 python3.8.1
# From /usr/local/share/man/man1
cd /usr/local/share/man/man1
sudo rm -r python3.1 python3.8.1

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档