Inkscape.org
Beginners' Questions ModuleNotFoundError: No module named 'cssselect'
  1. #1
    GOEDIBLE GOEDIBLE @GOEDIBLE

    I'm using Inkscape 1.2.2 (b0a8486541, 2022-12-01) on Bookworm Puppy Linux.

    When trying to use measure path on a polygon I get:

    Traceback (most recent call last):
      File "/usr/share/inkscape/extensions/measure.py", line 31, in <module>
        import inkex
      File "/usr/share/inkscape/extensions/inkex/__init__.py", line 11, in <module>
        from .extensions import *
      File "/usr/share/inkscape/extensions/inkex/extensions.py", line 34, in <module>
        from .elements import (
      File "/usr/share/inkscape/extensions/inkex/elements/__init__.py", line 10, in <module>
        from ._base import ShapeElement, BaseElement
      File "/usr/share/inkscape/extensions/inkex/elements/_base.py", line 38, in <module>
        from ..styles import Style, Classes
      File "/usr/share/inkscape/extensions/inkex/styles.py", line 33, in <module>
        from .css import ConditionalRule
      File "/usr/share/inkscape/extensions/inkex/css.py", line 27, in <module>
        import cssselect
    ModuleNotFoundError: No module named 'cssselect'

     

    Chat GPT said to do sudo apt-get install python3-lxml

    I did and still doesn't work.

  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    Might be some useful info here: https://gitlab.com/inkscape/inkscape/-/issues/2886

     

  3. #3
    GOEDIBLE GOEDIBLE @GOEDIBLE

    the new error is:

    Traceback (most recent call last):
      File "/usr/share/inkscape/extensions/measure.py", line 31, in <module>
        import inkex
      File "/usr/share/inkscape/extensions/inkex/__init__.py", line 11, in <module>
        from .extensions import *
      File "/usr/share/inkscape/extensions/inkex/extensions.py", line 34, in <module>
        from .elements import (
      File "/usr/share/inkscape/extensions/inkex/elements/__init__.py", line 13, in <module>
        from ._polygons import PathElement, Polyline, Polygon, Line, Rectangle, Circle, Ellipse
      File "/usr/share/inkscape/extensions/inkex/elements/_polygons.py", line 31, in <module>
        from ..bezier import pointdistance
      File "/usr/share/inkscape/extensions/inkex/bezier.py", line 29, in <module>
        import numpy
    ModuleNotFoundError: No module named 'numpy'

  4. #4
    GOEDIBLE GOEDIBLE @GOEDIBLE

    her's what Chat GPT said:

    It looks like you're encountering a ModuleNotFoundError for numpy when trying to run an Inkscape extension, which indicates that the numpy library isn't installed in your environment.

    To resolve this issue, you'll need to install numpy. Here's how you can do it:

    1. Using pip: Open a terminal and type the following command to install numpy:

      pip install numpy
      
    2. Using your system's package manager (if on Linux): On some Linux systems, you can install numpy through your package manager. For example, on Ubuntu or Debian-based systems, you can use:

      sudo apt-get install python3-numpy
      
    3. Virtual Environment: If you are working within a virtual environment, activate it and then install numpy using the same pip command:

      pip install numpy
      

    Once installed, try running the extension again, and the error should be resolved. Let me know if you run into any further issues!

Inkscape Inkscape.org Inkscape Forum Beginners' Questions ModuleNotFoundError: No module named 'cssselect'