Skip to main content

Hatch Latest Release License Pipeline Status Pylint PyPI PyPI Downloads

Synopsis

This is a small Python package that installs a command-line utility to facilitate extension installation in Blender. It currently provides the following functionality:

  • Validate and build Blender extensions, including their dependency wheels.
  • Generate a shell environment file for setting the PYTHONPATH environment variable to match Blender's Python path.
  • Print information about Blender and its internal Python environment.
  • Install Python packages directly into Blender's modules directory.
  • Create a Python virtual environment with the bpy package installed.

Links

GitLab

Other Repositories

Usage

Install this package, preferably in a Python virtual environment.

# Create the virtual environment.
python3 -m venv

# Activate it.
source venv/bin/activate

# Ensure that pip is installed and up-to-date.
python3 -m ensure pip
pip install -U pip

# Install this package.
pip install -U Blender Python Utils

blender-pytuils Executable

The package will install the blender-pyutils command that accepts different subcommands as arguments.

usage: blender-pyutils [-h] {build,env,info,pip,venv} ...

Utility script for validating and packaging Blender extensions.

positional arguments:
  {build,env,info,pip,venv}

options:
  -h, --help            show this help message and exit

build Subcommand

The build subommand will validate and build a Blender extension. If a requirements.txt file is found in the extension directory then it will also download the dependency wheels to the wheels subdirectory and add them to the blender_manifest.toml.

usage: blender-pyutils build [-h] [-p PATH]
                             [--manifest-template MANIFEST_TEMPLATE]
                             [--use-git-ver]

Validate and build an extension. If a requirements.txt file is found in the
extension directory then the wheels for its dependencies will be downloaded to
the wheels directory and the manifest will be updated to include them.

options:
  -h, --help            show this help message and exit
  -p, --path PATH       The path to the extension's root directory. If not
                        given, the current working directory is assumed.
  --manifest-template MANIFEST_TEMPLATE
                        An optional path to a template for for generating the
                        Blender manifest. The template should be a valid
                        manifest file without a "wheels" section.
  --use-git-ver         Update the manifest version from Git metadata. This
                        will use tags if available, else revision counts.

env Subcommand

The env subcommand generates a sourceable shell file that can be used to match the shell's PYTHONPATH environment variable to Blender's internal Python path. Sourcing the file will allow scripts and code editors to find Blender's internal Python packages.

usage: blender-pyutils env [-h] [--example] [-o OUT]

Create a soureable shell configuration file that will set the Python path
environment variable to match Blender's Python path. This will allow scripts
and editors to detect Blender's internal Python modules.

options:
  -h, --help     show this help message and exit
  --example      Mask user name in home directory paths for example output.
  -o, --out OUT  The output path. If not specified, the file will be printed
                 to STDOUT.

Example Output

#!/usr/bin/sh
export PYTHONPATH=/usr/share/blender/5.1/scripts/startup:/usr/share/blender/5.1/scripts/modules:/usr/lib/python314.zip:/usr/lib/python3.14:/usr/lib/python3.14/lib-dynload:/home/user/.config/blender/5.1/extensions/.local/lib/python3.14/site-packages:/tmp/tmp.THh359BQA7/venv/lib/python3.14/site-packages:/tmp/cwd/src:/home/user/dmm/inria/git/user/prometa/src:/usr/share/blender/5.1/scripts/freestyle/modules:/home/user/.config/blender/5.1/scripts/addons/modules:/usr/share/blender/5.1/scripts/addons_core


info Subcommand

The info subcommand will print information about Blender's version, module directory path and configured Python executable.

usage: blender-pyutils info [-h] [--example] [-j]

Print Blender information.

options:
  -h, --help  show this help message and exit
  --example   Mask user name in home directory paths for example output.
  -j, --json  Use JSON output format.

Example Output

Blender module directory: /home/user/.config/blender/5.1/scripts/modules
Blender version: 5.1.2
Python executable: /usr/bin/python3.14
Python path: /usr/share/blender/5.1/scripts/startup:/usr/share/blender/5.1/scripts/modules:/usr/lib/python314.zip:/usr/lib/python3.14:/usr/lib/python3.14/lib-dynload:/home/user/.config/blender/5.1/extensions/.local/lib/python3.14/site-packages:/tmp/tmp.THh359BQA7/venv/lib/python3.14/site-packages:/tmp/cwd/src:/home/user/dmm/inria/git/user/prometa/src:/usr/share/blender/5.1/scripts/freestyle/modules:/home/user/.config/blender/5.1/scripts/addons/modules:/usr/share/blender/5.1/scripts/addons_core
Python version: 3.14.6

{
  "Blender module directory": "/home/user/.config/blender/5.1/scripts/modules",
  "Blender version": "5.1.2",
  "Python executable": "/usr/bin/python3.14",
  "Python path": "/usr/share/blender/5.1/scripts/startup:/usr/share/blender/5.1/scripts/modules:/usr/lib/python314.zip:/usr/lib/python3.14:/usr/lib/python3.14/lib-dynload:/home/user/.config/blender/5.1/extensions/.local/lib/python3.14/site-packages:/tmp/tmp.THh359BQA7/venv/lib/python3.14/site-packages:/tmp/cwd/src:/home/user/dmm/inria/git/user/prometa/src:/usr/share/blender/5.1/scripts/freestyle/modules:/home/user/.config/blender/5.1/scripts/addons/modules:/usr/share/blender/5.1/scripts/addons_core",
  "Python version": "3.14.6"
}

pip Subcommand

The pip subcommand will install Python packages directly to Blender's modules directory. It accepts the same commands as pip.

# Example: install scipy using pip
blender-pyutils pip install scipy

# Example: install scipy using uv
blender-pyutils pip --uv install scipy

# Example: use "--" to pass through options to pip, such as a requirements.txt file
blender-pyutils pip -- install -U -r requirements.txt
usage: blender-pyutils pip [-h] [--path PATH] [--uv] <PIP ARG> [<PIP ARG> ...]

Install Python packages to Blender's module directory. Additional arguments as
passed through to pip.

positional arguments:
  <PIP ARG>    Arguments to pass through to pip. Precede these arguments with
               "--" if any of them begin with "-".

options:
  -h, --help   show this help message and exit
  --path PATH  Installation directory for Python packages. If not given, the
               default Blender module directory will be used. Use the "info"
               command to show the path to the module directory.
  --uv         Use "uv pip" instead of pip.

Caveats

Legacy Script

This repository originally only provided blender-pip_install.sh as a wrapper around pip install and uv pip install. It has been superceded by blender-pyutils pip and users should migrate accordingly.

venv Subcommand

The venv subcommand will create a Python virtual environment with the bpy PyPI package installed. It will try to match the version to the local Blender installation. It will also ensure that the virtual environment uses the required version of Python to install the package, even if this version is different from the one used internally by the local version of Blender. This mismatch may occur when packages modifify the Blender package to work with a different version of Python, despite each release of Blender officially supporting only a single version of Python.

usage: blender-pyutils venv [-h] path

Create a Python virtual environment with the PyPI bpy package installed. This
will try to match the version to the currently installed version of Blender
but it will default to the latest version if the installed version cannot be
found. The created virtual environment will also use the version of Python
required by the bpy package. Officially, Blender only supports a single
version of Python with each release but packagers sometimes patch Blender to
work with different versions.

positional arguments:
  path        The virtual environment path.

options:
  -h, --help  show this help message and exit

Release files for blender-pyutils 2026.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blender-pyutils 2026.5
File Size Uploaded
blender_pyutils-2026.5.tar.gz 16.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blender-pyutils 2026.5
File Interpreter ABI Platform
blender_pyutils-2026.5-py3-none-any.whl Python 3 none any Details

Total release size: 33.7 kB

Release files / blender_pyutils-2026.5.tar.gz

Download URL blender_pyutils-2026.5.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f7e1d50ff6e89c9ed80bda250de9372c2f3f4a00bd0db3659555a6b51421282
BLAKE2b-256 checksum
How to use checksums
2aa3f43777113cba75b2b7a5309039fbd587306919f789445950b8672b72981a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / blender_pyutils-2026.5-py3-none-any.whl

Download URL blender_pyutils-2026.5-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5af017fb33ef21a3469ccdd6c0c0b25c223f238a867df2502ce8609c14658cb
BLAKE2b-256 checksum
How to use checksums
f06c6eac2ea17a423da31a06ca1c280d70060b87ab764701fdc8e0573a00a8c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

2026.6

2 release files

This release

2026.5 This release

2 release files

2026.3

2 release files

2026.2

2 release files

2026.1

2 release files

2025.4

2 release files

2025.3

2 release files

2025.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page