简体   繁体   中英

CMake Error : Could NOT find PythonLibsUnix

I have the following problem when I try to compile Blender :

Could NOT find PythonLibsUnix (missing: PYTHON_LIBRARY PYTHON_LIBPATH
PYTHON_INCLUDE_DIR PYTHON_INCLUDE_CONFIG_DIR)

OS: Ubuntu 20.04.

Thanks.

I got the same error on openSUSE tumbleweed. The error message is misleading, it actually requires a certain version of python, 3.9 in my case. I installed python39-devel package and the error went away.

From Building Blender on Ubuntu

To get the code first you run

mkdir ~/blender-git
cd ~/blender-git
git clone https://git.blender.org/blender.git

And then you download the libraries. This is the missing PYTHON_LIBRARY that by default is looked into the directory above.

mkdir ~/blender-git/lib
cd ~/blender-git/lib
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64

After that you can build normally from the source directory

cd ~/blender-git/blender
make update
make

This is a bit of a hack and maybe not the best solution, but it worked for me.

I am going to assume you downloaded the precompiled libraries using

mkdir ~/blender-git/lib
cd ~/blender-git/lib
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64

All required libraries should be in that blender-git/lib directory.

When running the make command, Cmake will automatically look for the libraries in the directory above. I created a symbolic link in the directory above that points to the lib folder:

 ~/blender-git$ cd ..
 ~/$ ln -s  blender-git/lib lib

Then running

~/$ cd blender-git 
~/blender-git$ make

should work, and will find all required libraries.

I'm sure there is a better way to point Cmake to the right folder, but this hack worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM