The public available documentation for installation of InkCut on Windows is poor (https://www.codelv.com/projects/inkcut/download/). This docs contain information on how to install the generic python way and how to make a standalone executable for yourself.

(info) Disadvantages of InkCut

  • is only compatible with .svg files
  • you cannot import multiple .svg files into the editor. So you will need to prepare a nested SVG file containing all the stuff you want

1. Regular installation on Windows using Python

Download and install Python 3.7.6 64 Bit (3.8.0 ist inkompatible with InkCut 2.1.1 so we use 3.7.*)

Test functionality of python and pip

Start cmd.exe and install python modules using pip

pip3 install --upgrade pip
pip3 install --user pybin
pip3 install pyqt5
pip3 install --upgrade setuptools
pip3 install wheel
pip3 install lxml-4.3.5-cp37-cp37m-win_amd64.whl
pip3 install git+https://github.com/codelv/inkcut.git #install from Master Branch

Start InkCut

Upgrading

pip3 install --upgrade inkcut

#or install specific commit id, like
pip3 install --upgrade git+git://github.com/inkcut/inkcut.git@edf633f2478eb107e8fa510c2cda2e2758463570

    

2. Windows Executable Build

Now that you have InkCut up and running you might want to stop executing it by entering "inkcut" into console to start it. Maybe you want to put it on another computer without installing all the Python stuff. That's why we make a standalone executable. You can follow this tutorial our just download pre-compiled versions. See below.

(warning) Note that those builds might still be unstable! Please invest time to have a look in the log files for stacktraces, errors and warnings.

Check for recent modules

#not fully sure what of the following is really required:
pip3 install --upgrade pip
pip3 install --upgrade pyqt5 pycparser future pyzmq serial pyyaml constantly idna hyperlink attrs six Automat zope.interface PyHamcrest incremental twisted ply qtpy kiwisolver atom enaml enamlx pyqtgraph ipython-genutils decorator traitlets pywin32 jupyter-core tornado parso jedi wcwidth prompt-toolkit pickleshare pygments colorama backcall ipython python-dateutil jupyter-client ipykernel qtconsole pyserial jsonpickle lxml qt-reactor inkcut

Remove serial and check for recent PySerial module

pip3 uninstall serial
pip3 uninstall pyserial
pip3 install pyserial

Edit compat.py

edit line 431 C:\Users\inky\AppData\Local\Programs\Python\Python37\lib\site-packages\PyInstaller\compat.py

replace:
out = out.decode(encoding)

with:
out = out.decode(encoding, errors='ignore')

Erase the content from pyi_rth_twisted.py

PyInstaller has a non working standard hook in compability with InkCut. Open the following file and remove it's content (best idea: rename the file and create a new empty file with same name)

C:\Users\inky\AppData\Local\Programs\Python\Python37\Lib\site-packages\PyInstaller\loader\rthooks\pyi_rth_twisted.py

(info) More info: https://github.com/kivy/kivy/issues/4182

Erase the content from hook-zmq.py

This file needs to be blanked too because it throws a lot of warnings while packing with PyInstaller. Open the following file and remove it's content (best idea: rename the file and create a new empty file with same name)

C:\Users\inky\AppData\Local\Programs\Python\Python37\Lib\site-packages\PyInstaller\hooks\hook-zmq.py

Run the build command

(info) The icon file was generated manually using IcoFX.

Note that you maybe have to delete old content first before building inkcut!

cd C:\Users\inky\AppData\Local\Programs\Python\Python37\lib\site-packages\inkcut\

#prepare to remove old stuff first if existent. We want to keep the sources clean. We check out the recent inkcut git repository from master branch
pip3 uninstall -y inkcut
cd C:\Users\inky\AppData\Local\Programs\Python\Python37\lib\site-packages
DEL /F/Q/S inkcut
pip3 install git+git://github.com/inkcut/inkcut.git
copy C:\Users\inky\AppData\Local\Inkcut\inkcut.ico C:\Users\inky\AppData\Local\Programs\Python\Python37\lib\site-packages\inkcut\res\icons\
cd inkcut\
del /F/Q/S build\
del /F/Q/S dist\

#Optional step: generate test executable (not bundled, not windowed) and run it
cls & del /Q build\ & del /Q dist\ & py -3.7 -m PyInstaller app.py -n=inkcut --clean -i=res\icons\inkcut.ico --noconfirm --add-data="..\enaml;enaml" --add-data="..\enamlx;enamlx" --add-data="..\qtconsole;qtconsole" --add-data="..\zmq;zmq" --add-data="..\ipykernel;ipykernel" --add-data="..\future;future" --add-data="..\serial;serial" --add-data="..\twisted\internet;twisted\internet" --add-data="..\yaml;yaml" --add-data="cli;inkcut\cli" --add-data="console;inkcut\console" --add-data="core;inkcut\core" --add-data="device;inkcut\device" --add-data="job;inkcut\job" --add-data="joystick;inkcut\joystick" --add-data="monitor;inkcut\monitor" --add-data="preview;inkcut\preview" --add-data="res;inkcut\res" --add-data="ui;inkcut\ui" --hidden-import qreactor --hidden-import jsonpickle --hidden-import win32print --hidden-import iso8601 & dist\inkcut\inkcut.exe

#build the final standalone inkcut.exe
py -3.7 -m PyInstaller app.py -n=inkcut --clean -i=res\icons\inkcut.ico --noconfirm --add-data="..\enaml;enaml" --add-data="..\enamlx;enamlx" --add-data="..\qtconsole;qtconsole" --add-data="..\zmq;zmq" --add-data="..\ipykernel;ipykernel" --add-data="..\future;future" --add-data="..\serial;serial" --add-data="..\twisted\internet;twisted\internet" --add-data="..\yaml;yaml" --add-data="cli;inkcut\cli" --add-data="console;inkcut\console" --add-data="core;inkcut\core" --add-data="device;inkcut\device" --add-data="job;inkcut\job" --add-data="joystick;inkcut\joystick" --add-data="monitor;inkcut\monitor" --add-data="preview;inkcut\preview" --add-data="res;inkcut\res" --add-data="ui;inkcut\ui" --hidden-import qreactor --hidden-import jsonpickle --hidden-import win32print --hidden-import iso8601 --onefile --windowed
 
#execute the fresh build and test it
dist\inkcut.exe

(info) Size of bundled executable could be reduced by better selection of --add-data and --hidden-import files. This is tedious to do.

Troubleshooting

Failed to execute script pyi_rth_pkgres

Solution

Downgrade setuptools

pip3 install --upgrade "setuptools<45.0.0"

List Versions

pip3 list > version.txt

3. Pre-compiled Downloads

Download here

4. Hints when executing with InkScape

Note that if you have installed Python and inkcut and you enter "inkcut" in cmd you will start inkcut from Python package. If you put inkcut.exe native built to %PATH% please double check that you execute the right thing. Especially this might be a difference when working with InkScape extension. If the following stacktrace occures run "pip3 uninstall -y inkcut" to remove Python inkcut. Alternatetively modify InkScape extension (*.py / *.inx files) to call "inkcut.exe" instead "inkcut"

Traceback (most recent call last):
  File "fablabchemnitz_inkcut_open.py", line 66, in <module>
    effect.affect()
  File "C:\inkscape-0.92.4-x64\share\extensions\inkex.py", line 283, in affect
    self.effect()
  File "fablabchemnitz_inkcut_open.py", line 61, in effect
    p.stdin.write(inkex.etree.tostring(document))
IOError: [Errno 32] Broken pipe

5. Logs and configuration

... is stored in %USERPROFILE%\.config\inkcut

6. Language Translation

#Linux
apt install qttools5-dev-tools qt5-default
lupdate inkcut/*/*.enaml -I inkcut/*/*/*.enaml -ts inkcut/res/translations/de_DE.ts

#Windows
lupdate.exe -extensions enaml C:\Users\inky\AppData\Local\Programs\Python\Python37\lib\site-packages\inkcut -ts de_DE.ts
  • No labels

11 Comments

  1. Anonymous

    Hi Mario Voight.. Thankyou for the documentation.
    Reached here form inkscape plugins page..

  2. Hey. Happy you found it. I will soon upload a newer compilation for Windows. A lot of commits were done last weeks so it's worth make another try (smile)

  3. Anonymous

    Thankyou, thankyou!

    Finally able to trash my windows XP machine and have my Roland CX-24 running under windows 10 using INKSCAPE and INKCUT.


  4. Anonymous

    Is the download available?

  5. Anonymous

    Thank you! Can confirm it works fine here

  6. Anonymous

    Now that I have Inkcut working (thanks again for the link!) how do you install/activate the plugin for inkscape/inkcut?

  7. Hey,

    the plugin for InkScape can be found at

    you will need to put inx and py files into the InkScape directory, e.g. inkscape-0.92.5-x64\inkscape\share\extensions

    Then restart InkScape and you will find a new sub menu within InkScape extensions drop down

    I did not test it with InkScape 1.0+ versions yet so it might fail.

  8. Anonymous

    Copied as above. Extension now shows new submenu but...

    Traceback (most recent call last):

    File "inkcut_open.py", line 24, in <module>

    optparse_spec = importlib.util.find_spec("optparse")

    AttributeError: module 'importlib' has no attribute 'util'

  9. Anonymous

      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "C:\Users\mobius\AppData\Local\Programs\Python\Python37-32\Scripts\inkcut.exe\__main__.py", line 7, in <module>
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\inkcut\app.py", line 99, in main
        workbench.run()
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\inkcut\core\workbench.py", line 147, in run
        from enaml.workbench.core.core_manifest import CoreManifest
      File "<frozen importlib._bootstrap>", line 983, in _find_and_load
      File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\enaml\core\import_hooks.py", line 151, in exec_module
        code, _ = self.get_code()
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\enaml\core\import_hooks.py", line 412, in get_code
        return self.compile_code()
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\enaml\core\import_hooks.py", line 376, in compile_code
        ast = parse(self.read_source(), file_info.src_path)
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\enaml\core\parser\__init__.py", line 42, in parse
        return _parser.parse(enaml_source, filename)
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\enaml\core\parser\base_parser.py", line 206, in parse
        return self.parser.parse(source, debug=0, lexer=lexer)
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\ply\yacc.py", line 333, in parse
        return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\ply\yacc.py", line 1120, in parseopt_notrack
        p.callable(pslice)
      File "c:\users\mobius\appdata\local\programs\python\python37-32\lib\site-packages\enaml\core\parser\parser36.py", line 118, in p_atom10
        p[0] = m.body[0].value
    IndexError: list index out of range