Bug 1293069 - Python gedit plugins not working
Python gedit plugins not working
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gedit (Show other bugs)
7.2
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Ray Strode [halfline]
Desktop QE
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-19 15:50 EST by Martin Zidek
Modified: 2017-02-20 23:59 EST (History)
10 users (show)

See Also:
Fixed In Version: gedit-plugins-3.14.1-4.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
the patch for gedit package (7.89 KB, patch)
2016-01-24 13:00 EST, Matěj Cepl
no flags Details | Diff
the patch for gedit-plugins package (13.46 KB, patch)
2016-01-24 13:02 EST, Matěj Cepl
no flags Details | Diff
the patch for gedit-plugins package (14.03 KB, patch)
2016-01-25 19:18 EST, Matěj Cepl
no flags Details | Diff
archive with RPM packages (2.47 MB, application/zip)
2016-04-12 01:05 EDT, Matěj Cepl
no flags Details
archive with RPM packages (6.90 MB, application/zip)
2016-04-12 01:06 EDT, Matěj Cepl
no flags Details
gedit process maps file (71.78 KB, text/plain)
2016-04-14 07:30 EDT, Martin Zidek
no flags Details

  None (edit)
Description Martin Zidek 2015-12-19 15:50:17 EST
Description of problem:

Plugins written in pyton cannot be enabled in gedit, resulting error

(gedit:27707): libpeas-WARNING **: Error initializing Python Plugin Loader: PyGObject initialization failed
ImportError: could not import gobject (could not find _PyGObject_API object)

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

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

(gedit:27707): libpeas-WARNING **: The 'python' plugin loader has not been enabled

(gedit:27707): libpeas-WARNING **: The 'python' plugin loader has not been enabled

Version-Release number of selected component (if applicable):

libpeas-1.12.1-1.el7.x86_64
gedit-3.14.3-9.el7.x86_64

How reproducible:

Always.


Steps to Reproduce:
1. Run gedit
2. Open settings window with plugin selection
3. Try to enable "External Tools" plugin.

Actual results:

Error and plugin is marked with "one way" sign.

Expected results:

Plugin should be enabled.


Additional info:
Comment 2 Matěj Cepl 2016-01-24 13:00 EST
Created attachment 1117652 [details]
the patch for gedit package

gedit plugins are actually split into two packages (at least): some plugins go with the gedit package itself, rest of those provided by GNOME project go with gedit-plugins. Unfortunately (from the point of view of GNOME project, among many other reasons), RHEL-7 doesn’t provide Python 3, so we need to patch all those Python plugins to use Python 2 (and also all future Python plugins you want to use, because libpeas can load only one plugin runner at the time).

This patch fixes all gedit plugins.
Comment 3 Matěj Cepl 2016-01-24 13:02 EST
Created attachment 1117653 [details]
the patch for gedit-plugins package

This is a next patch in the series fixing all gedit-plugins plugins.
Comment 4 Matěj Cepl 2016-01-25 19:18 EST
Created attachment 1118297 [details]
the patch for gedit-plugins package
Comment 5 Matthias Clasen 2016-01-28 08:34:43 EST
thanks for the patch
Comment 6 Matthias Clasen 2016-04-06 16:48:17 EDT
This patch is already applied in gedit-plugins-3.14.1-2.el7
Comment 7 Rik Theys 2016-04-11 10:19:57 EDT
Hi,

We're (still) seeing the same issue. We're already running 3.14.1-2.el7 but the problem remains. The icon changes to the one-way icon and the following message is logged:

(gedit:856): libpeas-WARNING **: The 'python' plugin loader has not been enabled

Regards,

Rik


$ rpm -qa |grep gedit
gedit-plugin-wordcompletion-3.14.1-2.el7.x86_64
gedit-plugin-colorschemer-3.14.1-2.el7.x86_64
gedit-plugin-charmap-3.14.1-2.el7.x86_64
gedit-plugin-bracketcompletion-3.14.1-2.el7.x86_64
gedit-plugin-commander-3.14.1-2.el7.x86_64
gedit-plugin-joinlines-3.14.1-2.el7.x86_64
gedit-plugin-colorpicker-3.14.1-2.el7.x86_64
gedit-plugins-data-3.14.1-2.el7.x86_64
gedit-plugin-multiedit-3.14.1-2.el7.x86_64
gedit-plugins-3.14.1-2.el7.x86_64
gedit-plugin-codecomment-3.14.1-2.el7.x86_64
gedit-plugin-terminal-3.14.1-2.el7.x86_64
gedit-plugin-drawspaces-3.14.1-2.el7.x86_64
gedit-plugin-bookmarks-3.14.1-2.el7.x86_64
gedit-plugin-synctex-3.14.1-2.el7.x86_64
gedit-plugin-smartspaces-3.14.1-2.el7.x86_64
gedit-3.14.3-9.el7.x86_64
gedit-plugin-textsize-3.14.1-2.el7.x86_64
Comment 8 Matěj Cepl 2016-04-12 01:05 EDT
Created attachment 1146196 [details]
archive with RPM packages

These are the archives of my gedit-plugins, which work.
Comment 9 Matěj Cepl 2016-04-12 01:06 EDT
Created attachment 1146197 [details]
archive with RPM packages

The same for gedit package itself.
Comment 10 Martin Zidek 2016-04-12 08:05:14 EDT
I tried both stock and rpms form Matej with same result

stock:

zidek@o:~/tmp/current$ gedit 

(gedit:20708): libpeas-WARNING **: Error initializing Python Plugin Loader: PyGObject initialization failed
ImportError: could not import gobject (could not find _PyGObject_API object)

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

(gedit:20708): libpeas-WARNING **: Loader 'python' is not a valid PeasPluginLoader instance
zidek@o:~/tmp/current$ su
o:current# rpm -qa |grep gedit
gedit-plugin-synctex-3.14.1-2.el7.x86_64
gedit-plugin-colorschemer-3.14.1-2.el7.x86_64
gedit-plugin-drawspaces-3.14.1-2.el7.x86_64
gedit-plugin-terminal-3.14.1-2.el7.x86_64
gedit-3.14.3-9.el7.x86_64
gedit-plugin-bracketcompletion-3.14.1-2.el7.x86_64
gedit-plugin-codecomment-3.14.1-2.el7.x86_64
gedit-plugin-charmap-3.14.1-2.el7.x86_64
gedit-plugin-bookmarks-3.14.1-2.el7.x86_64
gedit-plugin-wordcompletion-3.14.1-2.el7.x86_64
gedit-plugin-smartspaces-3.14.1-2.el7.x86_64
gedit-plugin-commander-3.14.1-2.el7.x86_64
gedit-plugin-joinlines-3.14.1-2.el7.x86_64
gedit-plugin-colorpicker-3.14.1-2.el7.x86_64
gedit-plugins-data-3.14.1-2.el7.x86_64
gedit-plugins-3.14.1-2.el7.x86_64
gedit-plugin-textsize-3.14.1-2.el7.x86_64
gedit-plugin-multiedit-3.14.1-2.el7.x86_64
o:current#

Matej's rpms



zidek@o:~/tmp/current$ gedit 

(gedit:21090): libpeas-WARNING **: Error initializing Python Plugin Loader: PyGObject initialization failed
ImportError: could not import gobject (could not find _PyGObject_API object)

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

(gedit:21090): libpeas-WARNING **: Loader 'python' is not a valid PeasPluginLoader instance
zidek@o:~/tmp/current$ su
o:current# rpm -qa | grep gedit
gedit-plugin-commander-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-drawspaces-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-bracketcompletion-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugins-data-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugins-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-synctex-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-wordcompletion-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-colorschemer-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-charmap-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-3.14.3-9.0.3.el7.x86_64
gedit-plugin-smartspaces-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-colorpicker-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-bookmarks-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-joinlines-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-codecomment-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-textsize-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-terminal-3.14.1-2.0.7.MCgit.el7.x86_64
gedit-plugin-multiedit-3.14.1-2.0.7.MCgit.el7.x86_64
o:current# exit
Comment 11 Ray Strode [halfline] 2016-04-12 15:13:17 EDT
So it looks like the issue here is gedit 3.14 requires pygobject3 3.14 and there's no explicit dependency pulling that in.

Martin if you upgrade pygobject3 does your problem go away? I've only been able to reproduce your problem by downgrading pygobject3 to the 7.1 packages.
Comment 12 Ray Strode [halfline] 2016-04-12 15:35:07 EDT
i've built gedit-plugins-3.14.1-4.el7 with Requires: pygobject3 >= 3.14.0 now, marking MODIFIED
Comment 13 Martin Zidek 2016-04-13 03:05:12 EDT
still same problems, I have

zidek@o:~$ gedit 

(gedit:30861): libpeas-WARNING **: Error initializing Python Plugin Loader: PyGObject initialization failed
ImportError: could not import gobject (could not find _PyGObject_API object)

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

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

Error is displayed when I try to enable "External tools" (Externí nástroje in czech) in plugins.

What I have


o:zidek# rpm -qa | grep pygobject3
pygobject3-base-3.14.0-3.el7.x86_64
pygobject3-3.14.0-3.el7.x86_64

o:zidek# rpm -qa | grep gedit
gedit-3.14.3-9.el7.x86_64
o:zidek#
Comment 14 Matěj Cepl 2016-04-13 07:58:14 EDT
Perhaps version of libpease? What do you have?

matej@mitmanek: rpms$ rpm -qa \*peas\*
libpeas-devel-1.12.1-1.el7.x86_64
libpeas-1.12.1-1.el7.x86_64
libpeas-debuginfo-1.12.1-1.el7.x86_64
matej@mitmanek: rpms$
Comment 15 Martin Zidek 2016-04-13 08:06:16 EDT
It seems I have same versions as you.

o:zidek# rpm -qa \*peas\*
libpeas-1.12.1-1.el7.x86_64
o:zidek#
Comment 16 Ray Strode [halfline] 2016-04-13 15:06:48 EDT
is it possible you didn't restart gedit after upgrading pygobject3 ?

can you post the output of

$ cat /proc/$(pidof gedit)/maps
$ ldd /usr/bin/gedit
$ sudo rpm -qV gedit gedit-plugins pygobject3 pygobject3-base libpeas ?
Comment 17 Martin Zidek 2016-04-14 07:30:21 EDT
I restarted gedit

maps file as attachment

nb:mzi# rpm -qv gedit  pygobject3 pygobject3-base libpeas 
gedit-3.14.3-9.el7.x86_64
pygobject3-3.14.0-3.el7.x86_64
pygobject3-base-3.14.0-3.el7.x86_64
libpeas-1.12.1-1.el7.x86_64
nb:mzi# 

external tools plugin is included in gedit package, no need to install gedit-plugins
Comment 18 Martin Zidek 2016-04-14 07:30 EDT
Created attachment 1147175 [details]
gedit process maps file
Comment 19 Ray Strode [halfline] 2016-04-14 15:41:51 EDT
oh can you run comment 17 again with a capital V instead of a lowercase v ?
Comment 20 Martin Zidek 2016-04-14 15:57:39 EDT
mzi@nb:~$ rpm -qV gedit  pygobject3 pygobject3-base libpeas 
mzi@nb:~$
Comment 24 Martin Zidek 2016-04-17 06:07:04 EDT
It seems that problem is not in gedit-plugins, but in gedit package, because externaltools plugin is included in gedit package

mzi@nb:~/Obrázky$ rpm -ql gedit|grep externaltools
/usr/lib64/gedit/plugins/externaltools
/usr/lib64/gedit/plugins/externaltools.plugin
/usr/lib64/gedit/plugins/externaltools/__init__.py
/usr/lib64/gedit/plugins/externaltools/__init__.pyc
/usr/lib64/gedit/plugins/externaltools/__init__.pyo
/usr/lib64/gedit/plugins/externaltools/appactivatable.py
/usr/lib64/gedit/plugins/externaltools/appactivatable.pyc
/usr/lib64/gedit/plugins/externaltools/appactivatable.pyo
/usr/lib64/gedit/plugins/externaltools/capture.py
/usr/lib64/gedit/plugins/externaltools/capture.pyc
/usr/lib64/gedit/plugins/externaltools/capture.pyo
/usr/lib64/gedit/plugins/externaltools/filelookup.py
/usr/lib64/gedit/plugins/externaltools/filelookup.pyc
/usr/lib64/gedit/plugins/externaltools/filelookup.pyo
/usr/lib64/gedit/plugins/externaltools/functions.py
/usr/lib64/gedit/plugins/externaltools/functions.pyc
/usr/lib64/gedit/plugins/externaltools/functions.pyo
/usr/lib64/gedit/plugins/externaltools/library.py
/usr/lib64/gedit/plugins/externaltools/library.pyc
/usr/lib64/gedit/plugins/externaltools/library.pyo
/usr/lib64/gedit/plugins/externaltools/linkparsing.py
/usr/lib64/gedit/plugins/externaltools/linkparsing.pyc
/usr/lib64/gedit/plugins/externaltools/linkparsing.pyo
/usr/lib64/gedit/plugins/externaltools/manager.py
/usr/lib64/gedit/plugins/externaltools/manager.pyc
/usr/lib64/gedit/plugins/externaltools/manager.pyo
/usr/lib64/gedit/plugins/externaltools/outputpanel.py
/usr/lib64/gedit/plugins/externaltools/outputpanel.pyc
/usr/lib64/gedit/plugins/externaltools/outputpanel.pyo
/usr/lib64/gedit/plugins/externaltools/windowactivatable.py
/usr/lib64/gedit/plugins/externaltools/windowactivatable.pyc
/usr/lib64/gedit/plugins/externaltools/windowactivatable.pyo
/usr/share/gedit/plugins/externaltools
/usr/share/gedit/plugins/externaltools/tools
/usr/share/gedit/plugins/externaltools/tools/build
/usr/share/gedit/plugins/externaltools/tools/open-terminal-here
/usr/share/gedit/plugins/externaltools/tools/remove-trailing-spaces
/usr/share/gedit/plugins/externaltools/tools/run-command
/usr/share/gedit/plugins/externaltools/tools/send-to-fpaste
/usr/share/gedit/plugins/externaltools/ui
/usr/share/gedit/plugins/externaltools/ui/outputpanel.ui
/usr/share/gedit/plugins/externaltools/ui/tools.ui
/usr/share/glib-2.0/schemas/org.gnome.gedit.plugins.externaltools.gschema.xml
mzi@nb:~/Obrázky$
Comment 27 Jim 2016-08-12 18:51:45 EDT
From https://bugs.centos.org/view.php?id=10403 it looks like he worked around this bug by downgrading pygobject3 and pygobject3-base with this command:
yum downgrade http://vault.centos.org/7.1.1503/os/x86_64/Packages/pygobject3-3.8.2-6.el7.x86_64.rpm http://vault.centos.org/7.1.1503/os/x86_64/Packages
Comment 28 Matěj Cepl 2016-08-13 02:30:59 EDT
(In reply to Jim from comment #27) 
> From https://bugs.centos.org/view.php?id=10403 it looks like he worked 
> around this bug by downgrading pygobject3 and pygobject3-base with this 
> command: 
> yum downgrade 
> http://vault.centos.org/7.1.1503/os/x86_64/Packages/pygobject3-3.8.2-6.el7. 
> x86_64.rpm http://vault.centos.org/7.1.1503/os/x86_64/Packages

That is strange. I have here: 

matej@mitmanek: vim-debug (master)$ rpm -qa pygobject3\*
pygobject3-3.14.0-3.el7.x86_64
pygobject3-devel-3.14.0-3.el7.x86_64
pygobject3-base-3.14.0-3.el7.x86_64
matej@mitmanek: vim-debug (master)$
Comment 29 Matěj Cepl 2017-02-08 16:21:29 EST
Reporter, could you still reproduce this problem with the latest RHEL-7 updates?
Comment 30 dizzy 2017-02-16 13:14:43 EST
(In reply to Matěj Cepl from comment #29)
> Reporter, could you still reproduce this problem with the latest RHEL-7
> updates?

Hi, I have similar issue in CentOS (7.3.1611) - insync plugin for nautilus causes following error:
[rastiiik@nbtecra ~]$ nautilus -q
ImportError: could not import gobject (could not find _PyGObject_API object)

(nautilus:24587): Nautilus-Python-WARNING **: pygobject initialization failed

(nautilus:24587): Nautilus-Python-WARNING **: nautilus_python_init_python failed

[root@nbtecra ~]# rpm -qa pygobject3\*
pygobject3-3.14.0-3.el7.x86_64
pygobject3-base-3.14.0-3.el7.x86_64

Could You, please, confirm it is the same issue?

Thanx
Comment 31 Martin Zidek 2017-02-20 10:52:29 EST
With current gedit plugins everything is working OK.

zidek@o:~$ sudo rpm -qa | grep gedit
gedit-plugin-wordcompletion-3.14.1-5.el7.x86_64
gedit-plugin-drawspaces-3.14.1-5.el7.x86_64
gedit-plugin-colorschemer-3.14.1-5.el7.x86_64
gedit-plugin-codecomment-3.14.1-5.el7.x86_64
gedit-plugin-joinlines-3.14.1-5.el7.x86_64
gedit-plugin-multiedit-3.14.1-5.el7.x86_64
gedit-plugin-charmap-3.14.1-5.el7.x86_64
gedit-plugin-textsize-3.14.1-5.el7.x86_64
gedit-plugin-terminal-3.14.1-5.el7.x86_64
gedit-plugin-bookmarks-3.14.1-5.el7.x86_64
gedit-plugin-colorpicker-3.14.1-5.el7.x86_64
gedit-plugin-smartspaces-3.14.1-5.el7.x86_64
gedit-plugin-commander-3.14.1-5.el7.x86_64
gedit-3.14.3-18.el7.x86_64
gedit-plugin-bracketcompletion-3.14.1-5.el7.x86_64
gedit-plugins-data-3.14.1-5.el7.x86_64
gedit-plugins-3.14.1-5.el7.x86_64
gedit-plugin-synctex-3.14.1-5.el7.x86_64
zidek@o:~$
Comment 32 dizzy 2017-02-20 17:13:50 EST
hi, a few moments ago, an update has arrived:

Resolving Dependencies
--> Running transaction check
---> Package nautilus-python.x86_64 0:1.1-7.el7.nux will be updated
---> Package nautilus-python.x86_64 0:1.1-9.el7.nux will be an update
--> Finished Dependency Resolution

- since then, insync plugin for nautilus works again.

Thank You...
Comment 33 Jim 2017-02-20 23:59:36 EST
Working now for me as well:

gedit.x86_64         2:3.14.3-18.el7 
gedit-plugins.x86_64 3.14.1-5.el7

Note You need to log in before you can comment on or make changes to this bug.