Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sys.base_prefix instead of sys.prefix #9711

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading