Bug 1293069

Summary: Python gedit plugins not working
Product: Red Hat Enterprise Linux 7 Reporter: Martin Zidek <zidek>
Component: geditAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED CURRENTRELEASE QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: bugzillaredhat.jim-j, c.riess.dev, desktop-qa-list, mcepl, mclasen, olivier, rik.theys, rkrist, rstrode, tpelka, vchoudha, zidek
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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: 2017-09-11 14:08:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
the patch for gedit package
none
the patch for gedit-plugins package
none
the patch for gedit-plugins package
none
archive with RPM packages
none
archive with RPM packages
none
gedit process maps file none

Description Martin Zidek 2015-12-19 20:50:17 UTC
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 18:00:46 UTC
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 18:02:08 UTC
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-26 00:18:28 UTC
Created attachment 1118297 [details]
the patch for gedit-plugins package

Comment 5 Matthias Clasen 2016-01-28 13:34:43 UTC
thanks for the patch

Comment 6 Matthias Clasen 2016-04-06 20:48:17 UTC
This patch is already applied in gedit-plugins-3.14.1-2.el7

Comment 7 Rik Theys 2016-04-11 14:19:57 UTC
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 05:05:33 UTC
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 05:06:45 UTC
Created attachment 1146197 [details]
archive with RPM packages

The same for gedit package itself.

Comment 10 Martin Zidek 2016-04-12 12:05:14 UTC
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 19:13:17 UTC
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 19:35:07 UTC
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 07:05:12 UTC
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 11:58:14 UTC
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 12:06:16 UTC
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 19:06:48 UTC
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 11:30:21 UTC
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 11:30:54 UTC
Created attachment 1147175 [details]
gedit process maps file

Comment 19 Ray Strode [halfline] 2016-04-14 19:41:51 UTC
oh can you run comment 17 again with a capital V instead of a lowercase v ?

Comment 20 Martin Zidek 2016-04-14 19:57:39 UTC
mzi@nb:~$ rpm -qV gedit  pygobject3 pygobject3-base libpeas 
mzi@nb:~$

Comment 24 Martin Zidek 2016-04-17 10:07:04 UTC
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 22:51:45 UTC
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 06:30:59 UTC
(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 21:21:29 UTC
Reporter, could you still reproduce this problem with the latest RHEL-7 updates?

Comment 30 dizzy 2017-02-16 18:14:43 UTC
(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 15:52:29 UTC
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 22:13:50 UTC
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-21 04:59:36 UTC
Working now for me as well:

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