1diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py
2index d87922c0..859a30fb 100644
3--- a/python-package/xgboost/libpath.py
4+++ b/python-package/xgboost/libpath.py
5@@ -19,32 +19,4 @@ def find_lib_path():
6 lib_path: list(string)
7 List of all found library path to xgboost
8 """
9- curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
10- # make pythonpack hack: copy this directory one level upper for setup.py
11- dll_path = [curr_path, os.path.join(curr_path, '../../lib/'),
12- os.path.join(curr_path, './lib/'),
13- os.path.join(sys.prefix, 'xgboost')]
14- if sys.platform == 'win32':
15- if platform.architecture()[0] == '64bit':
16- dll_path.append(os.path.join(curr_path, '../../windows/x64/Release/'))
17- # hack for pip installation when copy all parent source directory here
18- dll_path.append(os.path.join(curr_path, './windows/x64/Release/'))
19- else:
20- dll_path.append(os.path.join(curr_path, '../../windows/Release/'))
21- # hack for pip installation when copy all parent source directory here
22- dll_path.append(os.path.join(curr_path, './windows/Release/'))
23- dll_path = [os.path.join(p, 'xgboost.dll') for p in dll_path]
24- elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
25- dll_path = [os.path.join(p, 'libxgboost.so') for p in dll_path]
26- elif sys.platform == 'darwin':
27- dll_path = [os.path.join(p, 'libxgboost.dylib') for p in dll_path]
28-
29- lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)]
30-
31- # From github issues, most of installation errors come from machines w/o compilers
32- if not lib_path and not os.environ.get('XGBOOST_BUILD_DOC', False):
33- raise XGBoostLibraryNotFound(
34- 'Cannot find XGBoost Library in the candidate path, ' +
35- 'did you install compilers and run build.sh in root path?\n'
36- 'List of candidates:\n' + ('\n'.join(dll_path)))
37- return lib_path
38+ return ["@libpath@/libxgboost@extention@"]