diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py index 2d69bda4d..fd53096ab 100644 --- a/python-package/xgboost/libpath.py +++ b/python-package/xgboost/libpath.py @@ -3,6 +3,7 @@ import os import platform +import sys class XGBoostLibraryNotFound(Exception): @@ -21,7 +22,8 @@ def find_lib_path(): curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) # make pythonpack hack: copy this directory one level upper for setup.py dll_path = [curr_path, os.path.join(curr_path, '../../lib/'), - os.path.join(curr_path, './lib/')] + os.path.join(curr_path, './lib/'), + os.path.join(sys.prefix, 'xgboost')] if os.name == 'nt': if platform.architecture()[0] == '64bit': dll_path.append(os.path.join(curr_path, '../../windows/x64/Release/'))