Inkscape cannot save as optimized svg (python-scour error)

Bug #1786724 reported by elric on 2018-08-13
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Patrick Storz

Bug Description

Here are the details of me trying to debug the problem. I'm not familiar with Python, so I don't know how else to debug the problem:

Ubuntu 18.04
Inkscape 0.92.3 (d244b95, 2018-08-02)
$ snap install inkscape

$ Inkscape save as... (optimized svg)
  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:
    cannot import name scourString

$ python -c "import scour"
$ echo $?
  0

$ sudo apt-get install python-scour
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  python-scour is already the newest version (0.36-2).

$ pip install scour
  Collecting scour
  Collecting six>=1.9.0 (from scour)
    Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
  Installing collected packages: six, scour
  Successfully installed scour-0.37 six-1.11.0

$ find / -name "scour" -type d 2>/dev/null
  drwxr-xr-x 3 root root /usr/lib/python3/dist-packages/scour
  drwxr-xr-x 2 root root /usr/lib/python2.7/dist-packages/scour
  drwxr-xr-x 2 root root /usr/share/scour
  drwxrwxr-x 3 user user /home/user/.local/lib/python2.7/site-packages/scour

$ python -c 'import sys; print(sys.path)'
  ['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/user/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']

$ Inkscape save as... (optimized svg)
  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:
    cannot import name scourString

$ python -c "import scour"
$ echo $?
  0

Alvin Penner (apenner) wrote :

possibly related to the fact that it is a snap installation, see:
https://bugs.launchpad.net/inkscape/+bug/1748596

could you try performing a File->Save As (Desktop Cutting Plotter) dxf to see if that also fails?

Patrick Storz (ede123) on 2018-08-13
tags: added: extensions-plugins packaging snap
removed: optimized scour
Patrick Storz (ede123) wrote :

Seems the snap packages did not specify Scour as a dependency, should be fixed in
  https://gitlab.com/inkscape/inkscape/commit/26d08e9c5b607e366c69f368682dcc5e17cae835
and
  https://gitlab.com/inkscape/inkscape/commit/f709311ff1b861fe9ccfd79cc21e233075ee94e2

However I'm not using the Snap package (or Linux for that matter), so somebody else will need to confirm wether it works as expected now.

Changed in inkscape:
milestone: none → 0.92.4
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Patrick Storz (ede123)
elric (spiritofelric-z) wrote :

Sorry for the slow reply.

@appener, "File->Save As (Desktop Cutting Plotter) dxf" saves just fine with a snap installation.

elric (spiritofelric-z) wrote :

@ede123, thanks for the swift turnaround on the commit. I'll keep an eye out for the updated version and refresh the snap.

$ snap list
  Name Version Rev Tracking Publisher Notes
  inkscape 0.92.3 4274 stable inkscape -

$ snap info inkscape
  refresh-date: 6 days ago, at 22:27 EDT
  channels:
    stable: 0.92.3 (4274) 177MB -
    candidate: 0.92.3 (4274) 177MB -
    beta: ↑
    edge: 0.92+devel (4265) 192MB -
  installed: 0.92.3 (4274) 177MB -

Patrick Storz (ede123) wrote :

@Ted Seeing there does not seem to be a manual fix for users do you think it's possible to get an updated Snap package with the missing dependency out? Or is it a lot of work to update?

Patrick Storz (ede123) wrote :

Ah, sorry for the noise, just noticed there actually is a newer "candidate" available.

According to https://snapcraft.io/inkscape
  sudo snap install inkscape --candidate
should do the trick

Daniel Dudas (daniel-d88) wrote :

I can save dxf without problems.

'sudo snap install inkscape --candidate' triggers a:

snap "inkscape" is already installed, see 'snap help refresh'

Bryce Harrington (bryce) on 2019-01-18
Changed in inkscape:
status: Fix Committed → Fix Released
Rgpublic (rgpublic) wrote :

Happens for me on 20.04. I don't use snap. Inkscape seems to be installed normally (i.e. via apt):

dpkg -l | grep inkscape
ii inkscape 0.92.5-1ubuntu1

Mega Volt (megavolt3) wrote :

Same thing as Rgpublic for me. Inkscape installed via apt, same version. Tried to install apt package 'scour', 'python3-scour' or python package 'scour' but all result in the following error while trying to export as Optimized SVG.

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

Mega Volt (megavolt3) wrote :

Update: Forgot to mention that package 'python-scour' no longer exists in apt.
Installing inkscape with inkscape's stable PPA fixed the problem

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

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

Duplicates of this bug

Other bug subscribers