Motivation
Since Inkscape 0.92, one can run extensions with a different python interpreter than the main application. I had to use this feature, because somehow Inkscape on my Ubuntu 20.04.3 LTS still used python 2.7.18 which the AxiDraw extension was not happy with.
The issue
“AxiDraw software must be run with python 3.6 or greater”
Investigation
-
The file
axidraw_deps/axidrawinternal/_init_.py
of the AxiDraw extension contains a check of the python version:# Bail out if python is less than 3.5 import sys MIN_VERSION = (3, 6) if sys.version_info < MIN_VERSION: sys.exit("AxiDraw software must be run with python 3.6 or greater.")
-
The extension interpreters clearly document which interpreter is chosen.
-
The file
axidraw.inx
specifies python as interpreter:<script> <command reldir="extensions" interpreter="python">axidraw_control.py</command> </script>
-
Since
~/.config/inkscape/preferences.xml
does not list a python-interpreter, my deprecated python interpreter seems to be chosen.
Now we understand all building blocks. Time for a fix!
The fix
Open the file ~/.config/inkscape/preferences.xml
and look for a <group>
with id="extensions"
. Add the following attribute:
python-interpreter="/usr/bin/python3"
(Assuming /usr/bin/python3
is the interpreter, you want to use.)
In my case, the lines look as follows.
<group
id="extensions"
python-interpreter="/usr/bin/python3"
org.inkscape.output.pdf.cairorenderer.PDFversion="PDF-1.5"
org.inkscape.output.pdf.cairorenderer.resolution="96"
org.inkscape.output.pdf.cairorenderer.bleed="0"
org.inkscape.input.gdkpixbuf.jpg.link="link"
command.evilmadscientist.axidraw-manager.copies="1"
command.evilmadscientist.axidraw-manager.page_delay="15"
Conclusion
-
Current Inkscape versions can use a different python interpreter than GIMP itself.
-
One needs to understand that there is a level of indirection:
python
in the INX file will look uppython-interpreter
in thepreferences.xml
file. -
The fix makes Inkscape run extensions with python3.