Status Update: VTK Python Wheels

There has been a concerted effort to improve the generation, delivery, and variability of Python wheels for VTK, all published on the VTK GitLab repository’s package registry (thank you, @ben.boeckel!!):

As of this post, VTK wheels are regularly generated for all OS/arch:

  • Release builds on tags (has the official version tag, e.g.: 9.2.6)
  • Weekly builds on master (has a tag like 9.2.20230401.dev0)

Latest release wheel:

Additional Wheel Variants: OSMesa

On these schedules, different wheel variants can be published, which are differentiated by the package distribution name. Right now, one variant is produced: vtk-osmesa.

The OSMesa wheel variant has VTK built to leverage offscreen rendering with OSMesa. This wheel is being built for both Linux and Windows at this time and bundles all of the necessary libraries into the wheel. These wheels are intended to be used by downstream projects in headless, CI-like environments or cloud application deployments, preventing the need to install any addition system packages.

Latest release OSMesa wheel:

Making these wheels accessible

You’ll notice on any release page that the install command is currently given as:

pip install vtk --index-url

At Kitware, we’ve set up to forward to the GitLab package index

This means that downstream packages can install from the Kitware-hosted package index by simply adding --extra-index-url to their pip install command or requirements.txt

pip install --extra-index-url vtk

or in requirements.txt:

# ... other packages

Example installation commands

Install the latest release wheel:

pip install --extra-index-url vtk

Install the latest wheel from master (use --pre and --no-cache to grab the most recenet wheel)

pip install --extra-index-url vtk --pre --no-cache

Install the OSMesa variant from the latest release

pip install --extra-index-url vtk-osmesa

I believe you can also set the environment variable PIP_EXTRA_INDEX_URL to have this enabled always:


Note that there are differences in pip’s --extra-index-url, --index-url, and --find-links and you may want to use one over the other for your use case.


When using the OSMesa wheel variant, you need to make sure none of the packages in your application require vtk as pip thinks vtk and vtk-osmesa are different packages (because they are), yet, they’re both under the vtk namespace and will conflict if installed in the same environment.

One example of where this can be a problem is when wanting the OSMesa wheel with PyVista. PyVista has vtk in its core requirements, so you either have to tell pip not to install PyVista’s dependencies or uninstall vtk before installing vtk-osmesa. This has the potential to be improved once is addressed.

For example:

pip install pyvista
pip uninstall vtk -y
pip install --extra-index-url vtk-osmesa

or explicitly install PyVista’s dependencies:

pip install pyvista --no-deps
pip install numpy pillow scooby pooch imageio matplotlib
pip install --extra-index-url vtk-osmesa

A better option for custom projects is to not have vtk be in the core requirements of a package but instead place vtk and vtk-osmesa in their own extra_requires/optional-dependencies sections:

For, this looks like:

        'onscreen': ['vtk'],
        'offscreen': ['vtk-osmesa'],

For pyproject.toml, this looks like:

onscreen = [
offscreen = [

Then install with the extra option:

pip install --extra-index-url package[offscreen]

TLDR; more/latest VTK wheels are available from

pip install --extra-index-url vtk