Inkscape: Failed to import Python module scour

Inkscape fails to save optimized svg files due to failure to properly identify or include dependencies.

1658 views
d

By. Jacob

Edited: 2022-03-26 12:22

Failed to import Python module 'scour'

There is a bug in Inkscape that causes this error when attempting to save an optimized SVG file, and it even happens when "scour" is correctly installed.

To solve the problem, add Inkscape as a PPA instead of installing from official repositories:

sudo add-apt-repository universe
sudo add-apt-repository ppa:inkscape.dev/stable
sudo apt-get update
sudo apt install inkscape

Failed to import Python module scour

On my system I also tried to solve the problem by installing scour using the following command in a terminal:

pip3 install scour

This did not work, so the error message is probably misleading.

The precise error message encountered when attempting to save the .svg file was:

Failed to import Python module 'scour'.
Please make sure it is installed (e.g. using 'pip install scour' or 'sudo apt-get install python-scour') and try again.

Details: No module named scour

The error message is inaccurate both because "scour" is installed on the system (using pip3 install scour), and because the "python-scour" package does not exist when trying to install it via apt install python-scour.

Tell us what you think:

Jim G

I think the issue may be that you were installing the Python 3 version of scour, but Inkscape is requiring the Python 2 version.

I was experiencing the same problem as you were. Installing scour using `python2.7 -m pip install scour` took care for it for me.

yurenchen

### install pip for py2
$ wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
$ python2 get-pip.py

### install scour for py2
$ python2 -m pip install scour

this solved my problems, agree with `Jim G`.