Where to enable libs when using a virtual Python environment?

I am using Python virtual environment. Basically, it works fine, but I am having trouble compiling some Python bindings, namely libIGL and pybind11.

CMake has the following Python related variables:

PYTHON_EXECUTABLE /users/me/libs/pyvenv/bin/python PYTHON_INCLUDE_DIR /usr/include/python2.7 PYTHON_LIBRARY /usr/lib64/libpython2.7.so 

It looks like it can correctly identify the executable , which is python3.5 of a previously activated virtual environment, but it detects some incorrect 2.7 paths for include and library.

Therefore, I would just like to set these paths manually in my virtual environment. I was looking at the directory structure of the virtual environment, and I think I found that it includes in /users/me/libs/pyvenv/include/python3.5m . But I can not find libpython* , there is no *.so file in general in my virtual environment. So which library should I use in this case?

+6
source share
1 answer

Limit Python libraries to match the version of the interpreter found in cmake:

 find_package(PythonInterp REQUIRED) find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" REQUIRED ) 

Or use FindPython if cmake> = 3.12 is available

0
source

Source: https://habr.com/ru/post/1270992/


All Articles