I have both Python 3.6 in "C:\PYTHON_VERSIONS\STANDARD_3.6.8" and 3.8 in "C:\Python\3.8" in my system. I want to compile pybind11 using 3.6 but CMake takes lib directories from 3.6 and the executable from 3.8! a very bad mix indeed.
Here is output of CMake:
-- Found PythonInterp: C:/Python/3.8/python.exe (found version "3.8.9")
-- Found PythonInterp: C:/Python/3.8/python.exe (found suitable version "3.8.9", minimum required is "3.6")
CMake Error at C:/work/packgen/rsdist/pybind11/tools/FindPythonLibsNew.cmake:147 (message):
Python config failure:
Traceback (most recent call last):
File "<string>", line 6, in <module>
File "C:\PYTHON_VERSIONS\STANDARD_3.6.8\lib\distutils\sysconfig.py", line 14, in <module>
import re
File "C:\PYTHON_VERSIONS\STANDARD_3.6.8\lib\re.py", line 123, in <module>
import sre_compile
File "C:\PYTHON_VERSIONS\STANDARD_3.6.8\lib\sre_compile.py", line 17, in <module>
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
AssertionError: SRE module mismatch
Call Stack (most recent call first):
CMakeLists.txt:25 (find_package)
I have in my environment variables PYTHONHOME and PYTHONPATH to the 3.6 folder:
And in the "path" variable itself there are no paths to any of the python installation folders.
So the question is: How does CMake finds executable that is not in the path, and mixes executable and libs of different versions?
Is there something like CMAKE_SET_PYTHON_PATH
or something that I force feed it into CMake?