Page MenuHome

Fix: Specify exact Python version for python3-dev on Debian&Ubuntu
ClosedPublic

Authored by Michael (michael64) on Jan 26 2022, 12:22 PM.

Details

Summary

Running ./blender/build_files/build_environment/install_deps.sh b/build_files on Ubuntu 20.04.3 LTS produces the following result (abbreviated):

If you're using CMake add this to your configuration flags:
  -D WITH_CODEC_SNDFILE=ON
  -D PYTHON_VERSION=3.8

Actually running the suggested make command results in an error:

Configuring Blender in "/home/dev/blender-git/build_linux" ...
CMake Error at CMakeLists.txt:910 (message):
  At least Python 3.9 is required to build, but found Python 3.8

On Ubuntu the default python3-dev package is currently version 3.8.2 while the package python3.9-dev is also installed but not used:

$ apt list --installed | egrep "python.*dev"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libpython3-dev/focal,now 3.8.2-0ubuntu2 amd64 [installed,automatic]
libpython3.8-dev/focal-updates,focal-security,now 3.8.10-0ubuntu1~20.04.2 amd64 [installed,automatic]
libpython3.9-dev/focal-updates,focal-security,now 3.9.5-3ubuntu0~20.04.1 amd64 [installed,automatic]
python3-dev/focal,now 3.8.2-0ubuntu2 amd64 [installed]
python3.8-dev/focal-updates,focal-security,now 3.8.10-0ubuntu1~20.04.2 amd64 [installed,automatic]
python3.9-dev/focal-updates,focal-security,now 3.9.5-3ubuntu0~20.04.1 amd64 [installed]

This diff specifies the exact Python version which is included in the package name thereby allowing install_deps.sh to suggest "-D PYTHON_VERSION=3.9" correctly.

Diff Detail

Repository
rB Blender

Event Timeline

Michael (michael64) requested review of this revision.Jan 26 2022, 12:22 PM
Michael (michael64) created this revision.

@Michael (michael64) Thanks for the patch, looks good, although it does not apply to latest master anymore, mind updating it? thanks.

The first hunk of the old diff is no longer necessary because PYTHON_VERSION_MIN has already been bumped in the meantime.

This revision is now accepted and ready to land.Jan 31 2022, 10:57 AM