I tried to add some plugins in gedit 3.10.4 on ubuntu 14.04LTS and some errors occured when I try to activate those plugins in 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'
And I see, on ged
plugin loader 'python3' was not found
Does anyone have an idea from where the problem could come?
I had this very same error with a different plugin (reST). The problem the error was caused by was that I had run it from the command line when a virtual environment was active. For this reason Python3 did not use (and find) the system libraries.
Solution: I ran gedit just normally from the GUI (or after deactivating the virtualenv in the Terminal), and the editor and the plugin just loaded fine. Double-check if you have a similar cause.
Otherwise you probably really have to check on what the error message says: Whether all "related packages required by libpeas" are installed. See details of package libpeas-1.0-0 for Trusty.
To add to @Railslide 's answer:
In your /usr/lib/gedit/plugin
search for your plugin file (e.g. bracketcompletion.plugin
) and change Loader=python3
to Loader=python
If this still returns an error - likely because it doesn't match python3
syntax: Use the command 2to3
as follows:
cd python_directory/
sudo 2to3 -f all -w *
e.g. for gedit-latex-plugin
...
cd /usr/lib/gedit/plugins/
sudo sed -i 's/python/python3/g' latex.plugin # only if you haven't already replaced python->python3
cd latex/
sudo 2to3 -f all -w *
Then this fixes the plug-in by replacing python2.x
code with python3
code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With