Extensions won't run, give lxml error

Bug #450927 reported by Paul Lusch on 2009-10-14
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
High
Unassigned
Arch Linux
New
Undecided
Unassigned

Bug Description

I'm getting this error when trying to run Extensions on Ubuntu 9.04 Jaunty:

"The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml"

I have libxml2 (2.6.32.dfsg-5ubuntu4.2) and python-lxml (2.1.5-1ubuntu2) installed.

Inkscape 0.47pre3 r22311

Reproducible example: Modify Path > Jitter nodes

All extensions I've tried fail with the same error, except for Generate from Path > Inset/Outset Halo.

su_v (suv-lp) on 2009-10-14
tags: added: extensions-plugins linux
tags: added: packaging
jazzynico (jazzynico) wrote :

Not reproduced on Ubuntu 9.10, Inkscape 0.47pre4.
I compile it almost every day (with ./configure --enable-lcms --enable-poppler-cairo --enable-inkboard --with-python), and I've never encountered that error message.
Could you confirm you still have this bug with the 0.47pre4 packaged version?

Changed in inkscape:
importance: Undecided → High
status: New → Incomplete
Paul Lusch (plusch) wrote :

Still having the same problem on Ubuntu 10.04, Inkscape 0.47 r22583.

libxml2 (2.7.6.dfsg-1ubuntu1) and python-lxml (2.2.4-1) are installed.

su_v (suv-lp) on 2010-05-09
Changed in inkscape:
status: Incomplete → Confirmed
Martin Owens (doctormo) wrote :

I'm marking as incomplete, please test with the latest version of Ubuntu and the latest Inkscape and confirm the problem is still there.

Changed in inkscape:
status: Confirmed → Incomplete
Matthew A (mrea1g12) wrote :

Hi, using Ubuntu 12.04 precise (x86_64) and Inkscape 0.48 I get this error message when using the LaTeX formula extension and the Tex Text extension. Out of interest I tried with another quasi-random extension (Perspective) and returned the same error. When I sudo apt-get install libxml2 it is already the newest version, same with python-lxml.

Changed in inkscape:
status: Incomplete → Confirmed
Silvio (silvio-sb-informatica) wrote :

I use Manjaro Linux 0.8.6 _64 (based on Arch) and installed the required package python-lxml 3.2.1-1, without resolution.

Same problem on version 0.48.4 r9939. A simple cut/copy operation show this error:

The module lxml interface with libxml2 is required by inkex.py and then by this extension. The latest version can be downloaded and installed from http://cheeseshop.python.org/pypi/lxml/ or via your package manager with a command like `sudo apt-get install python-lxml

su_v (suv-lp) wrote :

@Silvio:

1) Inkscape extensions require Python2, and won't run with Python3. It's up to the packager of inkscape for your distro to handle the migration from Python2 to Python3, not an Inkscape bug. Installing python modules for Python3 won't help (python-based extensions shipping with Inkscape are not yet compatible with Python3, and expect to run in a spawned Python2 process).

2) The errors on copy&pasting are likely due to
- Bug #418242 “Incorrect call to output plugins (with persistent error message) on copy”
  <https://bugs.launchpad.net/inkscape/+bug/418242>
Check whether you have one of the applications known to trigger it installed, and e.g. disable clipboard monitoring for any download helper apps while working with Inkscape.

Silvio (silvio-sb-informatica) wrote :

Thanks a lot, closing clipman the problem solve.

Matthew A (mrea1g12) wrote :

Still experiencing the same issue:

"The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml"

on Ubuntu 12.04 precise x86_64 with python 2.7.3 installed. Running

sudo apt-get install python-lxml

tells me

"python-lxml is already the newest version."

Mélodie (meets) wrote :

The error is on a x86_64 Archlinux install with the latest stable Inkscape, 0.48.4, and this page would have better not remove my comment when saving it! >:-'(

affects: inkscape (Arch Linux) → archlinux
Mélodie (meets) wrote :

PS: I have python-lxml installed at it's latest version too, and even with it installed I get the "Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected." ... "The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml" message on some actions, such as trying to save to the "Optimized *SVG ", and in some other actions which I don't remember right now.

summary: - Extensions won't run, give lxml error (Ubuntu Jaunty)
+ Extensions won't run, give lxml error
EmanueleSabetta (fmuaddib) wrote :

Same problem on OS X. Python-lxml is installed, yet Inkscape cannot find it.

su_v (suv-lp) wrote :

On 2014-06-11 11:37 +0100, EmanueleSabetta wrote:
> Same problem on OS X. Python-lxml is installed, yet Inkscape cannot
> find it.

@EmanueleSabetta - highly unlikley the same issue as on Ubuntu or other Linux distros. OS X users, please visit this report:
<https://bugs.launchpad.net/inkscape/+bug/819209>

(comment #17 has instructions for known workaround)

Matthew A (mrea1g12) wrote :

So... any idea for a fix?

I just reinstalled Inkscape again (up to 0.48.3.1 r9886, on Ubuntu 12.04 precise x86_64) and attempted to use a LaTeX formula extension, received the same error:

"The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml"

jmeidal (jmeidal) wrote :

Also finding this error on 0.91pre1_64bit for many extensions:

The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml

Technical details:
DLL load failed: %1 is not a valid Win32 application.

adam (shrode) wrote :

SUMMARY:
I encountered this issue with Windows 8.1 64bit build 0.91pre4 r13712. In this case it was a pathing issue.

STEPS TO REPRODUCE:
1. Install inkscape
2. PS C:\> if(![Environment]::GetEnvironmentVariable("PythonHome",[System.EnvironmentVariableTarget]::User)){[Environment]::SetEnvironmentVariable("PythonHome","c:\foobar",[System.EnvironmentVariableTarget]::User)}
3. Try to run a python extension

DETAILS:
This issue occurs when the environment variable PythonHome exists and does not point to the python executable bundled with Inkscape; by default, "C:\Program Files\Inkscape\python"

Dependent on the situation, the message under "Technical details" changes:
  If PYTHONHOME points to another installed python environment, I get "DLL load failed: %1 is not a valid Win32 application."
  If PYTHONHOME points to a non-existent python environment, I get "No module named lxml"

For installs via package managers on *nix (Ubuntu), python and/or the associated pip extension "lxml" may be pulled in as a dependency and installed to the lib of the python version instantiated by it. So two different python environments exist, but are not sharing resources.

USER-WORKAROUNDS (HACKS):
Windows: if no other Python version is installed you can delete the PythonHome variable:

PS C:\> if([Environment]::GetEnvironmentVariable("PythonHome",[System.EnvironmentVariableTarget]::User)){[Environment]::SetEnvironmentVariable("PythonHome","",[System.EnvironmentVariableTarget]::User)}
PS C:\> if([Environment]::GetEnvironmentVariable("PythonHome",[System.EnvironmentVariableTarget]::Machine)){[Environment]::SetEnvironmentVariable("PythonHome","",[System.EnvironmentVariableTarget]::Machine)}
and restart inkscape

or, consolidate the inkscape python lib (extensions) with the pre-existing python lib.

*nix: I cannot test for Ubuntu at the moment, but depending on your *nix, there are utilities to query the system for python; eselect (gentoo), python-config (neutral). To query the python executable that gets run; `ls -l $(which python)` will give you the path. You may also want to run `printenv | grep -i python`
You may also want to look at https://docs.python.org/2/using/unix.html#python-related-paths-and-files

Benoit (benoitponcelet-p) wrote :

Bonjour,

J'ai eu le meme problème sous Manjaro Linux ou Arch. J'ai résolu le problème sur deux ordinateurs au travail, la méthode semble fonctionner.

   - Désinstaller Inkscape: sudo Pacman -Rsn Inkscape
   - Installer "python-lxml": sudo Pacman -S python-lxml
   - Réinstaller Inkscape: sudo Pacman -S Inkscape
   - Et installer les dépendances optionnelles "pstoedit", "texlive-core", "python2-numpy", "python2-lxml", "uniconvertor":
      ( sudo Pacman -S pstoedit texlive-core python2-numpy python2-lxml uniconvertor )

Alors, il y a certainement des choses inutiles dans cette procédure, comme installer python-lxml et python2-lxml,
je n'ai pas chercher à comprendre, certain d'entre vous comprendrons sans doute mieu que moi. Mais en attendant, ça fonctionne. j'espère que pour vous aussi.

Benoit (benoitponcelet-p) wrote :

Hello,

I had the same problem from Manjaro Linux or Arch. I solved the problem on two computers at work, the method seems to work.

   - Uninstall Inkscape : sudo Pacman -Rsn Inkscape
   - Install " python- lxml ": sudo pacman -S python-lxml
   - Reinstall Inkscape : sudo pacman -S Inkscape
   - And install optional dependencies: "pstoedit", " texlive-core ", " python2-numpy ", " python2-lxml ", " uniconvertor "
      ( Sudo pacman -S pstoedit texlivecore python2-numpy python2-lxml uniconvertor )

So there is certainly unnecessary things in this procedure, such as installing python-lxml and python2-lxml ,
I did not try to understand , some of you probably understand better now than I did. But meanwhile , it works. I hope for you too.

Aissar Murad (aissarmurad) wrote :

The solution of Benoit works for me in Arch Linux.
The problem occurs because the Inkscape use Python 2.7 to plugins and the version that the Arch Linux installs by default is the latest.
If install python-lxml and python2-lxml would fix it.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers