resynthesizer icon indicating copy to clipboard operation
resynthesizer copied to clipboard

Python plugins not working (python2 and gimpfu)

Open Naheel-Azawy opened this issue 4 years ago • 9 comments

As issue #67 said, python2 is dead and python in my machine maps to python3. So, obviously non of the python plugins work... So I did:

~> find /usr/lib/gimp/2.0/plug-ins/ -name '*.py' | xargs sudo sed -i 's%/usr/bin/env python%/usr/bin/env python2.7%' $f

Then, gimpfu started to complain:

ImportError: No module named gimpfu

Any idea what can I do?

Naheel-Azawy avatar Apr 09 '20 20:04 Naheel-Azawy

You might try find where Gimp installs its Python plugins that ARE gimpfu (gimpfu.py and a few other modules) and move them where Python3 can find them. I can't remember whether Gimp installs them in the normal Python path, or changes the Python path before invoking Python. I don't know whether the Gimpfu modules are compatible with Python3. I will need to explore this issue myself.

Python2 is not dead, it is just not being fixed anymore. What system are you using, that does not ship Python2?

bootchk avatar Apr 09 '20 23:04 bootchk

I have the same issue on Arch Linux, where /usr/bin/env python currently points to python3.8.2.

Unfortunately because of changes in https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/gimp&id=e354374dae38ae90953218bb2fc3275ba77a9f11 (--disable-python), system version of Gimp is not shipped with gimpfu package anymore.

The change can be reverted by manually recompiling Gimp package using ABS and makepkg, and then resynthesizer works without errors.

pkubiak avatar Apr 11 '20 06:04 pkubiak

@bootchk I use Arch. As @pkubiak pointed, python points to python3. I guess I'll try to recompile gimp then... But no other solution?..

UPDATE: Tried recompiling, not much changed..

Naheel-Azawy avatar Apr 11 '20 13:04 Naheel-Azawy

I would guess it is only Arch that has changed how Gimp ships. I think Gimp has been shipping with its own Python 2. --disable-python omits that.

GimpFu is a Python module, definitely part of Gimp, that ships with Gimp.

There are plans to drop GimpFu from Gimp 3 (unless I can change their minds.) See other issues for resynthezier for details. I might need to port the resynthesizer plugins to PyGObject.

bootchk avatar Apr 12 '20 18:04 bootchk

For arch linux, you only need to install python2-gimp from the AUR.

See the post_ugprade for more details.

urandom avatar May 07 '20 20:05 urandom

@urandom Where have you been all that long! Thanks!

Naheel-Azawy avatar May 07 '20 22:05 Naheel-Azawy

JFTR manually installing older gimp-python and python-gtk2 also works around the issue in Debian distributions.

Here is a guide for Ubuntu: https://discourse.ubuntu.com/t/gimp-woes-in-20-04/15828/9 reported in https://github.com/bootchk/resynthesizer/issues/67#issuecomment-667769926

And for Debian testing/unstable users, getting the packages from stable works for now:

  • https://packages.debian.org/buster/amd64/python-gtk2/download
  • https://packages.debian.org/buster/amd64/gimp-python/download

ao2 avatar Sep 15 '20 19:09 ao2

JFTR manually installing older gimp-python and python-gtk2 also works around the issue in Debian distributions.

Here is a guide for Ubuntu: https://discourse.ubuntu.com/t/gimp-woes-in-20-04/15828/9 reported in #67 (comment)

And for Debian testing/unstable users, getting the packages from stable works for now:

* https://packages.debian.org/buster/amd64/python-gtk2/download

* https://packages.debian.org/buster/amd64/gimp-python/download

I'm on testing and gimp-python is not there any more. Did you see any viable solution for that? https://www.gimpusers.com/forums/gimp-user/21679-no-gimp-python-in-debian-testing

MrCsabaToth avatar Jan 30 '21 09:01 MrCsabaToth

For arch linux, you only need to install python2-gimp from the AUR.

See the post_ugprade for more details.

This package is no longer maintained and will not build. Is it not possible to use "Heal selection" in GIMP 2.10 running Arch Linux anymore?

rhysday avatar Feb 14 '21 00:02 rhysday