0
$\begingroup$

I've been compiling Blender for a short time now and use the scripts make update and make.

In one of the recent updates, it seems the python dependency changed to Python 3.9

CMake Error at CMakeLists.txt:842 (message): At least Python 3.9 is required to build

So of I installed Python 3.9. on my system. I then used

# update-alternatives

I now have:

# python --version
Python 3.9.2

But when I run make, I still see the original error.

# make

Configuring Blender in "/xxx/yyy/3D/Blender/blender-git/build_linux" ...
CMake Error at CMakeLists.txt:842 (message):
  At least Python 3.9 is required to build

I haven't been able to discern anything in the error logs that can help me out.

Does anybody have ideas how to fix this?

$\endgroup$
3
  • $\begingroup$ Rather than install a system python, suggest you download and build python.3.9.2 tarball from ftp.python.org (ibuilds to /opt folder in ubuntiu when using install deps script) and point the cmake python tags at it. _ $\endgroup$
    – batFINGER
    Mar 21, 2021 at 14:41
  • $\begingroup$ (ibuilds to /opt folder in ubuntiu when using install deps script) and point the cmake python tags at it. Could you please expand with more detail on this or point me to some documentation please? $\endgroup$
    – leoplaw
    Mar 21, 2021 at 19:30
  • $\begingroup$ @batFINGER cheers, the variables starting with “PYTHON_” in CMakeCache.txt were still pointing to the previous Python version that comes down with make update. I went through and edited all of these to use the new python version. make now works again. $\endgroup$
    – leoplaw
    Mar 22, 2021 at 0:46

1 Answer 1

0
$\begingroup$

make fails because of Python version, but I did not realise that Blender comes bundled with it's own Python package. So in the latest make update the code / scripts came bundled with latest Python version that they should be built against.

The following article gave me a hint for the solution. Building Blender with a different Python version

I edited ./build_linux/CMakeCache.txt

changing the all of the Python version number references to that of the new version found in

./lib/linux_centos7_x86_64/python/bin/

I could then successfully built Blender from source again.

$\endgroup$
4
  • $\begingroup$ Highly recommend cmake-gui for editing cmake configurations. Can generally make minor (or completely remove entries) changes and let it configure / generate the tags for you. $\endgroup$
    – batFINGER
    Mar 22, 2021 at 19:51
  • $\begingroup$ Cheers, @batFINGER, I didn't know that existed. $\endgroup$
    – leoplaw
    Mar 23, 2021 at 20:58
  • $\begingroup$ Deleting the CMakeCache.txt seems to do the trick as well, it get recreated when you build $\endgroup$
    – Youdje
    Apr 1, 2021 at 1:29
  • $\begingroup$ Thank you @Youdje! $\endgroup$
    – leoplaw
    Apr 1, 2021 at 16:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .