You are not logged in.

#1 2021-02-24 23:41:58

cscphy
Member
Registered: 2017-05-06
Posts: 36

[SOLVED] textext extension of inkscape

I installed the textext extension of inkscape. Version of textext is 1.3.0-1, inkscape is version 1.0.2-3.

When I try to run the extension, I incur the error

[Fail] TexText requirements

....

[Fail] GTK3 is not found

Gtk3 is actually installed (version 1:3.24.26-1), along with python-gobject 3.38.0-3 and python-lxml 4.6.2-1.

In the extension, the code that checks for gtk3 is found in requirements.py:

    def call_command(command, return_code=0):
        p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        stdout, stderr = p.communicate()
        if return_code is not None and p.returncode != return_code:
            raise subprocess.CalledProcessError(p.returncode,command)
        return stdout, stderr

....

    def find_pygtk3(self):
        try:
            executable = sys.executable
            defaults.call_command([executable, "-c", "import gi;"+
                                                     "gi.require_version('Gtk', '3.0');"+
                                                     "from gi.repository import Gtk, Gdk, GdkPixbuf"])
        except (KeyError, OSError, subprocess.CalledProcessError):
            return RequirementCheckResult(False, ["GTK3 is not found"])
        return RequirementCheckResult(True, ["GTK3 is found"])

As far as I can understand, the script tries to import some classes from "gi" and checks if it works.

But if I try to do "manually" these check, I don't get any error:

$ python
Python 3.9.1 (default, Feb  6 2021, 06:49:13) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version('Gtk', '3.0')
>>> from gi.repository import Gtk, Gdk, GdkPixbuf
>>> 

Notice that the default version of python is 3.

Last edited by cscphy (2021-02-26 10:45:50)

Offline

#2 2021-02-26 10:45:23

cscphy
Member
Registered: 2017-05-06
Posts: 36

Re: [SOLVED] textext extension of inkscape

It turns out that, due to an outdated entry in preferences.xml, inkscape was using python2.7 as interpreter, whereas the installed gtk3 libraries are for python 3. As discussed  here  the problem is solved by inserting

python-interpreter="/bin/python"

in $HOME/.config/inkscape/preferences.xml

Offline

Board footer

Powered by FluxBB