Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake's 'find_host_package(PythonInterp 2.7)' founds wrong Python version: #2386

Closed
yaoganxingwei opened this issue Aug 12, 2020 · 3 comments · Fixed by #2370
Closed

CMake's 'find_host_package(PythonInterp 2.7)' founds wrong Python version: #2386

yaoganxingwei opened this issue Aug 12, 2020 · 3 comments · Fixed by #2370

Comments

@yaoganxingwei
Copy link

CMake Warning at cmake/OpenCVDetectPython.cmake:81 (message):
CMake's 'find_host_package(PythonInterp 2.7)' founds wrong Python version:

PYTHON_EXECUTABLE=D:/Program Files/python/python.exe

PYTHON_VERSION_STRING=3.8.1

Consider specify 'PYTHON2_EXECUTABLE' variable via CMake command line or
environment variables

Call Stack (most recent call first):
cmake/OpenCVDetectPython.cmake:271 (find_python)
CMakeLists.txt:595 (include)

@YannickJadoul
Copy link
Collaborator

Is this related to pybind11? I only see cmake/OpenCVDetectPython.cmake in your error message.
Can you give some more details/further explanation/minimal example that reproduces this error?

@henryiii
Copy link
Collaborator

henryiii commented Aug 12, 2020

OpenCV has a heavily modified FindPythonInterp/FindPythonLibs search, just like we do (only more extreme for them; they are adding brand new sets of variables like PYTHON2_EXECUTABLE, we just add a few variables). They are very unlikely to ever be compatible. You can try pybind11 first, and see if OpenCV is happy with that (probably not).

Otherwise, wait until #2370 and then use PYBIND11_NOPYTHON mode.

@henryiii
Copy link
Collaborator

PS: find_host_package is not a CMake command, it's probably something added by OpenCV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants