Windows Manual Install and Manual Build

Info: For this description we use foo as a user name. Whenever it occures replace it with your personal windows user name.

Requirements

Install these dependancies to build a local build of inkstitch for windows.

  • Python

    Depending on your target arch, select either 32bit or 64 bit version and run the installer. Check “Add Python x.xx to PATH”. This for the bash enviroment to find python. Add python to path Then click on “Install now”

  • Git for windows

    This installs git as well as providing a terminal emulator to run build scripts.

    Download Use the default settings during installation.

  • nodejs

    Install LTS 32bit or 64bit version (depending on your target arch). Install with default settings.

  • Inno setup

    This provides the compiler to build the windows installer. Use the default settings.

  • make

    This provides make to run the build scripts.

    • Download make-3.82.90-20111115.zip
    • unzip
    • Create the folder C:\Make\bin
    • Copy make.exe from Downloads\make-3.82.90-20111115\make-3.82.90-20111115\bin_ix86 to C:\Make\bin

    Make folder with make.exe

PATHS

The bash environment needs some paths for the installed software. So let’s set it up.

  • Open Windows settings > System > About > Advanced system settings

    Windows settings

    About

  • In Advanced Settings click on Enviroment Vairables

    Advanced Settings

  • In User variables for [foo] click on Path (1) and then on Edit... (2)

    Environment Variables

  • For each of the paths below click on New then copy paste the file path:

    C:\Make\bin
    C:\Program Files (x86)\Inno Setup 6
    
  • Now it should look like this:

    Environment Variables

Enable long names for git

  • In the search bar type cdm and chose Run as administrator.

    Run CMD as administrator

  • Run the following command

    git config --system core.longpaths true
    
  • Close the command prompt, we do not need admin rights after this.

Download Ink/Stitch

  • If you already have an Ink/Stitch version installed uninstall it first to avoid double menu entries in Inkscape.

  • Go to Edit > Preferences > System and open your extensions folder.

    Inkscape extensions folder

    If you do not aim for manual install but want to install a build version do not follow this step, but choose any other directory to where you want to save the project files

  • Right click into the file browser and click on Git Bash Here to download Ink/Stitch into the extensions folder

    Right click menu

  • Run the following commands in the terminal emulator:

    git clone https://github.com/inkstitch/inkstitch
    git clone https://github.com/inkstitch/pyembroidery
    

Setup Python

  • For 32bit run the following commands in the terminal emulator:
    python -m pip install --upgrade pip
    python -m pip install wheel
    python -m pip install pillow==9.5.0
    python -m pip install numpy==1.23.1
    python -m pip install scipy==1.9.0
    pip install wxPython
    
  • For 64bit run the following commands in the terminal emulator:
    python -m pip install --upgrade pip
    python -m pip install wheel
    
  • Now we are ready to install the rest of the requirements through the Ink/Stitch requirements file
    python -m pip install -r inkstitch/requirements.txt
    
  • For debugging with pydevd also run:
    python -m pip install pydevd
    

Manual Install for developing Ink/Stitch

  • We prepared everything to finally setup Ink/Stitch itself. In your terminal emulator run:
    cd inkstitch
    make manual
    
  • You can now use the Ink/Stitch installation. Changes to the Python code take effect the next time the extension is run.
  • After adding a new template for new Ink/Stitch extensions, run the following command to update the Inskcape menu entries.
    make inx
    

    If you are running Ink/Stitch through Inkscape, close and reopen Inkscape after running the command.

Generate a build to test run your update on other Windows systems

  • To build Ink/Stitch you’ll need to install pyinstaller.
    python -m pip install pyinstaller==5.13.2
    
  • Ink/Stitch uses 7-zip to zip up the build file. So you need to install it as well. Add it to PATHS as described above as C:\Program Files\7-Zip (64bit) or C:\Program Files (x86)\7-Zip (32bit)

  • In the terminal emulator run:

    cd inkstitch
    make distlocal
    
  • In the file browser you will find the finished builds in the folder artifacts

    Do not install the build version if you have the manual install in the extensions folder or you’ll have duplicated menu entries.

Troubleshooting missing Python modules

If when trying to open Inkstitch, you encounter errors about missing Python modules: ModuleNotFoundError: No module named 'diskcache'

Most likely you will need to tell, Inkscape to use your Python version:

  • Within Inkscape, Go to Edit > Preferences > System > User preferences and click on Open.
  • In your user preferences folder, locate preferences.xml
  • Close Inkscape
  • Open preferences.xml with a text editor
  • Search for <group id="extensions"
  • Add this attribute python-interpreter="C:\Program Files\Python39\python.exe". Substitute the path with yours. You can find the path by running where python in a command prompt