Skip to content

Commit

Permalink
Use sys.base_prefix instead of sys.prefix (#9711)
Browse files Browse the repository at this point in the history
* Use sys.base_prefix instead of sys.prefix

* Update libpath.py too
  • Loading branch information
hcho3 authored Oct 24, 2023
1 parent 22e891d commit a408254
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python-package/packager/nativelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions python-package/xgboost/libpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit a408254

Please sign in to comment.