diff --git a/python-package/setup.py b/python-package/setup.py index a2146f6b..7f13a07b 100644 --- a/python-package/setup.py +++ b/python-package/setup.py @@ -7,28 +7,9 @@ import os from setuptools import setup, find_packages # import subprocess -sys.path.insert(0, '.') CURRENT_DIR = os.path.dirname(__file__) -# We can not import `xgboost.libpath` in setup.py directly since xgboost/__init__.py -# import `xgboost.core` and finally will import `numpy` and `scipy` which are setup -# `install_requires`. That's why we're using `exec` here. -libpath_py = os.path.join(CURRENT_DIR, 'xgboost/libpath.py') -libpath = {'__file__': libpath_py} -exec(compile(open(libpath_py, "rb").read(), libpath_py, 'exec'), libpath, libpath) - -LIB_PATH = [] -for libfile in libpath['find_lib_path'](): - try: - relpath = os.path.relpath(libfile, CURRENT_DIR) - LIB_PATH.append(relpath) - break # need only one - except ValueError: - continue - -print("Install libxgboost from: %s" % LIB_PATH) - # Please use setup_pip.py for generating and deploying pip installation # detailed instruction in setup_pip.py setup(name='xgboost', @@ -53,7 +34,6 @@ setup(name='xgboost', # this will use MANIFEST.in during install where we specify additional files, # this is the golden line include_package_data=True, - data_files=[('xgboost', LIB_PATH)], license='Apache-2.0', classifiers=['License :: OSI Approved :: Apache Software License', 'Development Status :: 5 - Production/Stable', diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py index a313a1b8..f161d50a 100644 --- a/python-package/xgboost/libpath.py +++ b/python-package/xgboost/libpath.py @@ -20,7 +20,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/'), + dll_path = ["/usr/lib", curr_path, + os.path.join(curr_path, '../../lib/'), os.path.join(curr_path, './lib/'), os.path.join(sys.prefix, 'xgboost')] if sys.platform == 'win32':