Skip to content

Commit 1029be1

Browse files
author
Thierry RAMORASOAVINA
committed
Fix the detection of an unhappy installation path in a venv under Windows
External tools like VSCode can modify the case of the path saved in `sys.executable`
1 parent b81ec6e commit 1029be1

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
### Fixed
1515
- (`sklearn`) Default value of `n_features` for the supervised estimators
16+
- (`core`) Detection of an unhappy installation path in a venv under Windows
1617

1718
## 11.0.0.2 - 2026-01-26
1819

khiops/core/internals/runner.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,11 +1240,17 @@ def _detect_library_installation_incompatibilities(self, library_root_dir):
12401240
# Under Windows, there are two cases :
12411241
(
12421242
# for conda-based installations python is inside 'base_dir'
1243-
str(Path(sys.executable).parents[0]) != base_dir
1243+
# (warning : the case of the path in sys.executable
1244+
# can be altered by some tools under Windows)
1245+
str(Path(sys.executable.lower()).parents[0])
1246+
!= base_dir.lower()
12441247
and
12451248
# for 'binary+pip' installations (within a virtual env)
12461249
# python is inside 'base_dir'/Scripts
1247-
str(Path(sys.executable).parents[1]) != base_dir
1250+
# (warning : the case of the path in sys.executable
1251+
# can be altered by some tools under Windows)
1252+
str(Path(sys.executable.lower()).parents[1])
1253+
!= base_dir.lower()
12481254
)
12491255
# Under Linux or MacOS a bin/ folder exists
12501256
or str(Path(sys.executable).parents[1]) != base_dir

0 commit comments

Comments
 (0)