Install Blender 3.4.0 As Python Module in Docker

Blender 3.4 release brought various changes to improve the support for running Blender as a Python module.

With the release, bpy 3.4.0 was made available on PyPi, installable through pip install bpy. Here’s how to get it running inside a Docker container.

Requirements

  • Python 3.10 which matches the bundled Python version of Blender 3.4.0 release

Dockerfile

FROM python:3.10.0
FROM python:3.10.0
RUN pip3 install https://files.pythonhosted.org/packages/9c/f3/732e7c6d6c0932b80df488a24e02ac34e8eae14a3c893eb97dcbf6e9c93c/bpy-3.4.0-cp310-cp310-manylinux_2_17_x86_64.whl

Building the Image

Build the image with linux/amd64 platform

docker build -t appname --platform=linux/amd64 .


Date
March 8, 2023