Replaced distutils module to sysconfig#21219
Merged
alalek merged 2 commits intoopencv:3.4from Dec 8, 2021
asenyaev:asen/remove_distutils
Merged
Replaced distutils module to sysconfig#21219alalek merged 2 commits intoopencv:3.4from asenyaev:asen/remove_distutils
alalek merged 2 commits intoopencv:3.4from
asenyaev:asen/remove_distutils
Conversation
alalek
reviewed
Dec 8, 2021
cmake/OpenCVDetectPython.cmake
Outdated
| if(NOT ANDROID AND NOT IOS) | ||
| if(CMAKE_HOST_UNIX) | ||
| execute_process(COMMAND ${_executable} -c "from distutils.sysconfig import *; print(get_python_lib())" | ||
| execute_process(COMMAND ${_executable} -c "from sysconfig import *; print(get_python_lib())" |
Member
There was a problem hiding this comment.
Looks like this doesn't work as expected (Linux x64 / Mac):
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable exact version "2.7.6")
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'get_python_lib' is not defined
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.4.3", minimum required is "3.2")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (found suitable exact version "3.4.3")
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'get_python_lib' is not defined
Contributor
Author
There was a problem hiding this comment.
I'm sorry, I didn't change the function here. Fixed it.
Merged
Member
This was referenced Dec 28, 2021
Closed
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes following issue #21141.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.