at 18.09-beta 3.1 kB view raw
1diff --git a/python-package/setup.py b/python-package/setup.py 2index e6c3386f..4ed0a8bd 100644 3--- a/python-package/setup.py 4+++ b/python-package/setup.py 5@@ -16,8 +16,6 @@ libpath_py = os.path.join(CURRENT_DIR, 'xgboost/libpath.py') 6 libpath = {'__file__': libpath_py} 7 exec(compile(open(libpath_py, "rb").read(), libpath_py, 'exec'), libpath, libpath) 8 9-LIB_PATH = [os.path.relpath(libfile, CURRENT_DIR) for libfile in libpath['find_lib_path']()] 10-print("Install libxgboost from: %s" % LIB_PATH) 11 # Please use setup_pip.py for generating and deploying pip installation 12 # detailed instruction in setup_pip.py 13 setup(name='xgboost', 14@@ -35,7 +33,6 @@ setup(name='xgboost', 15 # this will use MANIFEST.in during install where we specify additional files, 16 # this is the golden line 17 include_package_data=True, 18- data_files=[('xgboost', LIB_PATH)], 19 license='Apache-2.0', 20 classifiers=['License :: OSI Approved :: Apache Software License'], 21 url='https://github.com/dmlc/xgboost') 22diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py 23index d87922c0..859a30fb 100644 24--- a/python-package/xgboost/libpath.py 25+++ b/python-package/xgboost/libpath.py 26@@ -19,32 +19,4 @@ def find_lib_path(): 27 lib_path: list(string) 28 List of all found library path to xgboost 29 """ 30- curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) 31- # make pythonpack hack: copy this directory one level upper for setup.py 32- dll_path = [curr_path, os.path.join(curr_path, '../../lib/'), 33- os.path.join(curr_path, './lib/'), 34- os.path.join(sys.prefix, 'xgboost')] 35- if sys.platform == 'win32': 36- if platform.architecture()[0] == '64bit': 37- dll_path.append(os.path.join(curr_path, '../../windows/x64/Release/')) 38- # hack for pip installation when copy all parent source directory here 39- dll_path.append(os.path.join(curr_path, './windows/x64/Release/')) 40- else: 41- dll_path.append(os.path.join(curr_path, '../../windows/Release/')) 42- # hack for pip installation when copy all parent source directory here 43- dll_path.append(os.path.join(curr_path, './windows/Release/')) 44- dll_path = [os.path.join(p, 'xgboost.dll') for p in dll_path] 45- elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'): 46- dll_path = [os.path.join(p, 'libxgboost.so') for p in dll_path] 47- elif sys.platform == 'darwin': 48- dll_path = [os.path.join(p, 'libxgboost.dylib') for p in dll_path] 49- 50- lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)] 51- 52- # From github issues, most of installation errors come from machines w/o compilers 53- if not lib_path and not os.environ.get('XGBOOST_BUILD_DOC', False): 54- raise XGBoostLibraryNotFound( 55- 'Cannot find XGBoost Library in the candidate path, ' + 56- 'did you install compilers and run build.sh in root path?\n' 57- 'List of candidates:\n' + ('\n'.join(dll_path))) 58- return lib_path 59+ return ["@libpath@/libxgboost.so"]