Skip to content

Commit e894696

Browse files
committed
Fixes for python3 executables not detecting correctly in cmake. (patch by @abhiTronix)
1 parent 17d330f commit e894696

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import subprocess
88
import re
99
import sysconfig
10+
from sysconfig import get_paths as gp
1011

1112

1213
def main():
@@ -103,7 +104,8 @@ def main():
103104
]) + [
104105
# skbuild inserts PYTHON_* vars. That doesn't satisfy opencv build scripts in case of Py3
105106
"-DPYTHON_DEFAULT_EXECUTABLE=%s" % sys.executable,
106-
"-DPYTHON3_EXECUTABLE=%s" % sys.executable,
107+
"-DPYTHON3_LIBRARY=%s" % os.path.join('/usr/lib/x86_64-linux-gnu/', sysconfig.get_config_var('LDLIBRARY')),
108+
"-DPYTHON3_INCLUDE_DIR=%s" % gp()['include'],
107109
"-DBUILD_opencv_python3=ON",
108110
"-DBUILD_opencv_python2=OFF",
109111

0 commit comments

Comments
 (0)