Use sys.base_prefix instead of sys.prefix (#9711)

* Use sys.base_prefix instead of sys.prefix

* Update libpath.py too
This commit is contained in:
Philip Hyunsu Cho 2023-10-23 23:31:40 -07:00 committed by GitHub
parent 22e891dafa
commit a408254c2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -132,7 +132,7 @@ def locate_or_build_libxgboost(
if build_config.use_system_libxgboost:
# Find libxgboost from system prefix
sys_prefix = pathlib.Path(sys.prefix)
sys_prefix = pathlib.Path(sys.base_prefix)
sys_prefix_candidates = [
sys_prefix / "lib",
# Paths possibly used on Windows

View File

@ -34,10 +34,10 @@ def find_lib_path() -> List[str]:
# On Windows, Conda may install libs in different paths
dll_path.extend(
[
os.path.join(sys.prefix, "bin"),
os.path.join(sys.prefix, "Library"),
os.path.join(sys.prefix, "Library", "bin"),
os.path.join(sys.prefix, "Library", "lib"),
os.path.join(sys.base_prefix, "bin"),
os.path.join(sys.base_prefix, "Library"),
os.path.join(sys.base_prefix, "Library", "bin"),
os.path.join(sys.base_prefix, "Library", "lib"),
]
)
dll_path = [os.path.join(p, "xgboost.dll") for p in dll_path]