Installation fails due to relative path #1932

Closed
MaxBenChrist opened this Issue Jan 4, 2017 · 4 comments

Projects

None yet

3 participants

@MaxBenChrist
MaxBenChrist commented Jan 4, 2017 edited

For bugs or installation issues, please provide the following information.
The more information you provide, the more easily we will be able to offer
help and advice.

Environment info

Operating System: Ubuntu 16.04

After compiling, setup.py fails during installation of package

max@tuk:~/Documents/xgboost$ cd python-package; sudo python setup.py install
Install libxgboost from: ['/home/max/Documents/xgboost/python-package/xgboost/../../lib/libxgboost.so']
running install
running bdist_egg
running egg_info
creating xgboost.egg-info
writing requirements to xgboost.egg-info/requires.txt
writing xgboost.egg-info/PKG-INFO
writing top-level names to xgboost.egg-info/top_level.txt
writing dependency_links to xgboost.egg-info/dependency_links.txt
writing manifest file 'xgboost.egg-info/SOURCES.txt'
reading manifest file 'xgboost.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'xgboost/include'
warning: no files found matching '*' under directory 'xgboost/src'
warning: no files found matching '*' under directory 'xgboost/make'
warning: no files found matching '*' under directory 'xgboost/rabit'
warning: no files found matching '*' under directory 'xgboost/lib'
warning: no files found matching '*' under directory 'xgboost/dmlc-core'
warning: no previously-included files matching '*.o' found anywhere in distribution
warning: no previously-included files matching '*.a' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
writing manifest file 'xgboost.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/xgboost
copying xgboost/rabit.py -> build/lib.linux-x86_64-2.7/xgboost
copying xgboost/compat.py -> build/lib.linux-x86_64-2.7/xgboost
copying xgboost/core.py -> build/lib.linux-x86_64-2.7/xgboost
copying xgboost/training.py -> build/lib.linux-x86_64-2.7/xgboost
copying xgboost/plotting.py -> build/lib.linux-x86_64-2.7/xgboost
copying xgboost/sklearn.py -> build/lib.linux-x86_64-2.7/xgboost
copying xgboost/__init__.py -> build/lib.linux-x86_64-2.7/xgboost
copying xgboost/callback.py -> build/lib.linux-x86_64-2.7/xgboost
copying xgboost/libpath.py -> build/lib.linux-x86_64-2.7/xgboost
error: Error: setup script specifies an absolute path:

    /home/max/Documents/xgboost/python-package/xgboost/../../lib/libxgboost.so

setup() arguments must *always* be /-separated paths relative to the
setup.py directory, *never* absolute paths.
@MaxBenChrist MaxBenChrist changed the title from Installation fails to Installation fails due to relative path Jan 4, 2017
@diver-in-sky
Contributor
diver-in-sky commented Jan 6, 2017 edited

I've hacked setup.py by adding two lines (to change lib path from absolute to relative) and after that xgboost was successfully installed (OSX, virtualenv).

CURRENT_ABSOLUTE = os.path.dirname(os.path.realpath(__file__))
# replace LIB_PATH definition
LIB_PATH = [libpath['find_lib_path']()[0].replace(CURRENT_ABSOLUTE + '/', '')]
@nkeywal
nkeywal commented Jan 8, 2017

Same problem here (on Ubuntu 14.04, Python 3.4), the fix mentioned above worked.

@diver-in-sky diver-in-sky pushed a commit to diver-in-sky/xgboost that referenced this issue Jan 9, 2017
Andrey Tereskin Make lib path relatrive to fix setup error #1932 9f683ff
@diver-in-sky
Contributor

@MaxBenChrist @nkeywal could you please update master and check if your problem has been fixed?

@MaxBenChrist

It has been fixed. Everything is working fine now. Thank you very much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment