Skip to content

Dependency Installation

chsh2 edited this page May 27, 2023 · 8 revisions

General Instruction

Python dependencies are required for most functions of NijiGPen. The following table shows the add-on operators which require packages:

Operator Pyclipper triangle SciPy & SkImage
Polygon Boolean
Polygon Offset
Line Fit
Smart Fill
Mesh Generation
  • (*)
Line Art Import
Color Image Import

* Without triangle, some options of the "Delaunay Triangulation" mesh style will be invalid. The "Grid" mesh style is not affected.

** No packages are required for the GIMP/Adobe format support (brush import, PSD rendering and palette paste).


To install Python packages, the most straightforward way is the dependency manager in the add-on setting of the Preferences panel.

Click "Refresh" to check if packages are installed, and click "Install" button for those missing (Internet connection is required).

If the dependencies cannot be installed, there might be multiple reasons. Unfortunately, the add-on is not capable of solving all problems automatically. Please refer to the following sections for possible solutions.


System & Blender Version Requirements

Depending on your operating system and the way Blender is installed, additional steps may be required.

Windows

  • If Blender is installed through Microsoft Store, the dependencies may not be installed properly. It is NOT recommended to use this add-on with Blender from Microsoft Store.
  • If Blender is installed in a system folder (e.g., C:\Program Files\Blender Foundation\), you may need to run Blender as administrator to ensure the dependencies installed correctly.
    • If earlier you attempted to install dependencies without administrator permission and failed, it is recommended to remove all dependencies first (also as administrator) and then install them again.

Mac

  • Devices with Apple silicon (M1/M2) do not have the triangle package available. The other two packages can still be installed.
  • Due to the lack of test equipment, the system requirements of devices with Apple silicon are still not totally clear. A discussion thread is created for related issues.

Installation Logs

During the installation process, only limited information can be shown in the Blender's main window. However, you can find more information in the Blender console or terminal, which may indicate the issues happening during the installation. For example:

  • If the installation is stuck for a long time without any output logs, there might be an Internet connection issue. Please check your network configuration, such as the VPN setting.
  • If there are messages such as "normal site-packages is not writable", the administrator permission is required. Please refer to the last section.

Such logs are available in different ways, depending on your operating system.

Windows

The installation log is shown in the Blender console, which can be started in the menu by clicking [Window] - [Toggle System Console].

Mac

The installation log is available only when Blender is started from a terminal. To do that, please refer to https://docs.blender.org/manual/en/latest/advanced/command_line/launch/macos.html.

Linux

Please refer to https://docs.blender.org/manual/en/latest/advanced/command_line/launch/linux.html.


Manual Installation

Alternatively, the dependencies can be installed by typing commands manually.

Windows

Open either Command Prompt or PowerShell to type commands. Run them as administrator when necessary.

  1. Enter the Python folder of Blender. The directory looks like (Your Blender Installation Directory)\3.x\python\bin. For example, if you installed Blender 3.3 in the default folder, then use the following command: cd "C:\Program Files\Blender Foundation\Blender 3.3\3.3\python\bin".
  2. Enable the pip module of Python: .\python.exe -m ensurepip --upgrade
  3. Install packages: .\python.exe -m pip install pyclipper triangle scikit-image

Mac

Open Terminal and find the Blender directory as follows (using Blender 3.3 as an example):

cd /Applications/Blender.app/Contents/Resources/3.3/python/bin/
./python3.10 -m ensurepip
./python3.10 -m pip install pyclipper triangle scikit-image

Additional Tips for pip

If encountering problems during the pip package installation, you can try to use the following arguments: --no-cache-dir, --force-reinstall and --only-binary.

For example, the command to install triangle can be:

./python3.10 -m pip install --no-cache-dir --force-reinstall --only-binary=triangle triangle
Clone this wiki locally