Gedit plugins error when open from Terminal

I cannot seem to solve this mystery, when I open gedit from the menu, all the plugins work perfectly find. But when I open Gedit via the terminal, I can no longer use the plugins and when I try to turn them on, I get this:

I have tried to google around myself, but I'm getting no where.

I have check, regardless of where I open Gedit (terminal or menu), the path to the program is the same. I.E /usr/bin/gedit

Anyone have any ideas?

Can you give more information? Is this the “Code Comment” plugin you’re trying to use? What error do you get when you try to enable it?

FYI, the plugin needs to know the type of language/file you’re using so that it can use the relevant “comment” system(//, # etc). So unless that condition is met, you aren’t gonna be able to use the plugin…

It's for all added plugins when you do:
sudo apt-get install gedit-plugins

Errors:

(Sorry, I had this picture on my first post, but being a new member I could only post one picture, and I forgot to reply to my thread with this picture)

This is an old bug and had been fixed.
What version of Ubuntu MATE and gedit are you running?

Mate: 18.04.1
Gedit: 3.28.1

Are you trying to run Gedit with an active virtualenv?

Nope. :confused:

(My post needs 20 chars…)

Regarding the first warning, is python3-gi and/or python-gobject installed?

python3-gi was but python-gobject was not.

I used: sudo apt-get install python-gobject
To install it. It made no difference.

I’m not sure if it matters, but I do use anaconda3 for my python. Though, as I said above, I am not working within a virtualenv.

Just to rule it out, when you’re running gedit from the terminal, are you running it with sudo or as another user, or just as your own user?

You can go to the /usr/lib/gedit/plugin directory, find your plugin file and change Loader=python3 to Loader=python to see if that makes any difference…

Also can you check if you have all the necessary packages installed for libpeas?
apt-cache policy libgirepository-1.0-1 libc6 libglib2.0-0 libgtk-3-0 libpeas-common libpython3.6

Kindly Post the output as preformatted text(select the output and press Ctrl+Shift+C).

Check this post where @arunisnowhere found that anaconda replaced gsettings:

“Just to rule it out, when you’re running gedit from the terminal, are you running it with sudo or as another user, or just as your own user?”

I was running it as my own user. That said, I tried sudo gedit. And that worked fine. I tried chmod to give everyone permission, that did not seem to work.

“You can go to the /usr/lib/gedit/plugin directory, find your plugin file and change Loader=python3 to Loader=python to see if that makes any difference…”

"Also can you check if you have all the necessary packages installed for libpeas?
apt-cache policy libgirepository-1.0-1 libc6 libglib2.0-0 libgtk-3-0 libpeas-common libpython3.6

Kindly Post the output as preformatted text(select the output and press Ctrl+Shift+C)."

Was not at /usr/lib/gedit/plugin. I will find it tonight, I have to go for a few hours.

Output:

Installed: 1.56.1-1
Candidate: 1.56.1-1
Version table:
*** 1.56.1-1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
libc6:
Installed: 2.27-3ubuntu1
Candidate: 2.27-3ubuntu1
Version table:
*** 2.27-3ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
100 /var/lib/dpkg/status
libglib2.0-0:
Installed: 2.56.1-2ubuntu1
Candidate: 2.56.1-2ubuntu1
Version table:
*** 2.56.1-2ubuntu1 500
500 link_remove_per_forum_rules amd64 Packages
100 /var/lib/dpkg/status
libgtk-3-0:
Installed: 3.22.30-1ubuntu1
Candidate: 3.22.30-1ubuntu1
Version table:
*** 3.22.30-1ubuntu1 500
500 link_remove_per_forum_rulesamd64 Packages
100 /var/lib/dpkg/status
libpeas-common:
Installed: 1.22.0-2
Candidate: 1.22.0-2
Version table:
*** 1.22.0-2 500
500 link_remove_per_forum_rules amd64 Packages
500 link_remove_per_forum_rules i386 Packages
100 /var/lib/dpkg/status
libpython3.6:
Installed: 3.6.5-3
Candidate: 3.6.5-3
Version table:
*** 3.6.5-3 500
500 link_remove_per_forum_rules amd64 Packages
100 /var/lib/dpkg/status

I tried what @arunisnowhere did, but changing the name to gsettings_old did not work. So I changed it back. :confused:

You can try to uninstall Anaconda to see if the problem is there, it could be another overwritten bin file.

1 Like

I have seen reports on the internet about folks getting the same type of error even though this bug had been fixed way long ago! And yes anaconda might be responsible so uninstall it and see what happens…

On a side note, you can check the /usr/share/gedit/plugins directory for the plugin files if you didn’t find them earlier…

1 Like

If it's working when starts from the menu and not from the terminal, it's because the menu is starting gedit in a different environment.
I found next line in gedit's desktop file /usr/share/applications/org.gnome.gedit.desktop
DBusActivatable=true
There is an explanation in here: https://wiki.gnome.org/HowDoI/DBusApplicationLaunching

Particularly this line:

Starting processes with D-Bus activation ensures that each application gets started in its own pristine environment, as a direct descendent of the session -- not in the environment of whatever its parent happened to be.

So, to start it from the terminal and have plugins working you'll have to start gedit via dbus.

1 Like

I want to thank everyone that helped.

The solution:
It was anaconda, I just uninstalled anaconda. I don’t actually need it, just started using it for fun. :slight_smile:

2 Likes