Skip to content

Commit a7f77cc

Browse files
author
Thierry RAMORASOAVINA
committed
Add the detection of a python virtual environment when searching for unhappy installation paths under Windows
- python sys.base_prefix differs from sys.prefix in conda-based installation or pip installation within a virtual env
1 parent 0cd680a commit a7f77cc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

khiops/core/internals/runner.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,9 +1218,15 @@ def _detect_library_installation_incompatibilities(self, library_root_dir):
12181218
if (
12191219
platform.system() == "Windows"
12201220
and
1221-
# Under Windows, python is not in a bin/ folder
1222-
# for conda-based installations
1223-
str(Path(sys.executable).parents[0]) != base_dir
1221+
# Under Windows, there are two cases :
1222+
(
1223+
# for conda-based installations python is inside 'base_dir'
1224+
str(Path(sys.executable).parents[0]) != base_dir
1225+
and
1226+
# for 'binary+pip' installations (within a virtual env)
1227+
# python is inside 'base_dir'/Scripts
1228+
str(Path(sys.executable).parents[1]) != base_dir
1229+
)
12241230
# Under Linux or MacOS a bin/ folder exists
12251231
or str(Path(sys.executable).parents[1]) != base_dir
12261232
):

0 commit comments

Comments
 (0)