tomdeabreucodes / PyJig

This Python package provides functionality to generate jigsaw puzzle cut templates and digital puzzle sets. It includes functions for creating jigsaw templates, applying cuts, and generating SVG representations.
https://tomdeabreu.uk/posts/jigsaw-puzzle-cut-template-svg/
MIT License
3 stars 1 forks source link

Inkscape? #2

Closed RyannDaGreat closed 3 weeks ago

RyannDaGreat commented 3 weeks ago

How do I set up my environment to make this code work? Thank you!

Traceback (most recent call last):
  File "<rp-input-17>", line 8, in <module>
    myjig.generate_svg_jigsaw("./Pieces")
  File "/opt/homebrew/lib/python3.10/site-packages/pyjigsaw/jigsawfactory.py", line 250, in generate_svg_jigsaw
    bboxes = subprocess.check_output(
  File "/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/homebrew/Cellar/python@3.10/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'inkscape'
tomdeabreucodes commented 3 weeks ago

PyJig uses the Inkscape CLI to get the bounding boxes for each of the puzzle pieces.

It is a 3rd party programme, and the installation method varies depending on your OS, but there is a guide here which covers all bases.

I'll update the README to mention that.

tomdeabreucodes commented 3 weeks ago

https://github.com/tomdeabreucodes/PyJig/commit/1c6b44234e3f464834d2ef712d9879e80d8a02a6