xgboost==0.4a30
Operating System: Ubuntu 14.04 LTS
python -c 'import xgboost'
OSError: /usr/local/lib/python2.7/dist-packages/xgboost/./wrapper/libxgboostwrapper.so: invalid ELF header
file /usr/local/lib/python2.7/dist-packages/xgboost/./wrapper/libxgboostwrapper.so
/usr/local/lib/python2.7/dist-packages/xgboost/./wrapper/libxgboostwrapper.so: Mach-O 64-bit x86_64 dynamically linked shared library
Error is also present when passing the --no-binary :all:
option to pip install
pip install --no-cache-dir --no-binary :all: xgboost
The current workaround is using the normal installation route -- build from source.
For Linux users:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; make -j4
sudo python python-package/setup.py install
To install the latest tagged version (0.47) from source, check out that branch beforehand:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git checkout tags/0.47
make -j4
sudo python python-package/setup.py install
seems like the compilation failed on your system. please make sure you have gcc
on your system (by apt-get install build-essential
on ubuntu, other platform please change)
the reason: the libxgboostwrapper.so is a place holder for packing for pip
which should be automatically deleted after successful installation.
surely, installing from github as @moandcompany said works too, and it is the latest version with good new features.
The Python package scikit-learn
is also a prequisite dependency that is not automatically pulled in during the xgboost setup.py
install process via pip
We also observed that it appears the package version number is not being incremented on the 0.47 tag
python -c 'import xgboost; xgboost.__version__'
appears to report version 0.4
That is true that pip version is outdated. The new refactored code doesn't follow the old way for compiling on the fly when use pip, and some tries on deploying the new code but some troubles, so I rolled back and kept the old version on PyPI for now, will soon fix it.
Hi,
this issue is still present on Debian 9, pip 9.0.1, Python 2.7.13 and xgboost-0.6a2.
Most helpful comment
The current workaround is using the normal installation route -- build from source.
For Linux users:
To install the latest tagged version (0.47) from source, check out that branch beforehand: