PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/python-package/build_trouble_shooting.md

https://gitlab.com/github-cloud-corporation/xgboost
Markdown | 52 lines | 36 code | 16 blank | 0 comment | 0 complexity | 62059856f7bfb2ee501926824fa33c8a MD5 | raw file
  1. XGBoost Python Package Troubleshooting
  2. ======================
  3. Windows platform
  4. ------------
  5. The current best solution for installing xgboost on windows machine is building from github. Please go to [windows](/windows/), build with the Visual Studio project file, and install. Additional detailed instruction can be found at this [installation tutorial](https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/13043/run-xgboost-from-windows-and-python) from Kaggle Otto Forum.
  6. `pip install xgboost` is **not** tested nor supported in windows platform for now.
  7. Linux platform (also Mac OS X in general)
  8. ------------
  9. **Trouble 0**: I see error messages like this when install from github using `python setup.py install`.
  10. XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
  11. List of candidates:
  12. /home/dmlc/anaconda/lib/python2.7/site-packages/xgboost-0.4-py2.7.egg/xgboost/libxgboostwrapper.so
  13. /home/dmlc/anaconda/lib/python2.7/site-packages/xgboost-0.4-py2.7.egg/xgboost/../../wrapper/libxgboostwrapper.so
  14. /home/dmlc/anaconda/lib/python2.7/site-packages/xgboost-0.4-py2.7.egg/xgboost/./wrapper/libxgboostwrapper.so
  15. **Solution 0**: Please check if you have:
  16. * installed the latest C++ compilers and `make`, for example `g++` and `gcc` (Linux) or `clang LLVM` (Mac OS X). Recommended compilers are `g++-5` or newer (Linux and Mac), or `clang` comes with Xcode in Mac OS X. For installting compilers, please refer to your system package management commands, e.g. `apt-get` `yum` or `brew`(Mac).
  17. * compilers in your `$PATH`. Try typing `gcc` and see if your have it in your path.
  18. * Do you use other shells than `bash` and install from `pip`? In some old version of pip installation, the shell script used `pushd` for changing directory and triggering the build process, which may failed some shells without `pushd` command. Please update to the latest version by removing the old installation and redo `pip install xgboost`
  19. * Some outdated `make` may not recognize the recent changes in the `Makefile` and gives this error, please update to the latest `make`:
  20. `/usr/lib/ruby/gems/1.8/gems/make-0.3.1/bin/make:4: undefined local variable or method 'make' for main:Object (NameError)`
  21. **Trouble 1**: I see the same error message in **Trouble 0** when install from `pip install xgboost`.
  22. **Solution 1**: the problem is the same as in **Trouble 0**, please see **Solution 0**.
  23. **Trouble 2**: I see this error message when `pip install xgboost`. It says I have `libxgboostwrapper.so` but it is not valid.
  24. OSError: /home/dmlc/anaconda/lib/python2.7/site-packages/xgboost/./wrapper/libxgboostwrapper.so: invalid ELF header
  25. **Solution 2**: Solution is as in 0 and 1 by installing the latest `g++` compiler and the latest `make`. The reason for this rare error is that, `pip` ships with a pre-compiled `libxgboostwrapper.so` with Mac for placeholder for allowing `setup.py` to find the right lib path. If a system doesn't compile, it may refer to this placeholder lib and fail. This placeholder `libxgboostwrapper.so` will be automatically removed and correctly generated by the compiling on-the-fly for the system.
  26. **Trouble 3**: My system's `pip` says it can't find a valid `xgboost` installation release on `PyPI`.
  27. **Solution 3**: Some linux system comes with an old `pip` version. Please update to the latest `pip` by following the official installation document at <http://pip.readthedocs.org/en/stable/installing/>
  28. **Trouble 4**: I tried `python setup.py install` but it says `setuptools` import fail.
  29. **Solution 4**: Please make sure you have [setuptools](https://pypi.python.org/pypi/setuptools) before installing the python package.
  30. Mac OS X (specific)
  31. ------------
  32. Most of the troubles and solutions are the same with that in the Linux platform. Mac has the following specific problems.
  33. **Trouble 0**: I successfully installed `xgboost` using github installation/using `pip install xgboost`. But it runs very slow with only single thread, what is going on?
  34. **Solution 0**: `clang LLVM` compiler on Mac OS X from Xcode doesn't support OpenMP multi-thread. An alternative choice is installing `homebrew` <http://brew.sh/> and `brew install g++-5` which provides multi-thread OpenMP support.
  35. **Trouble 1**: Can I install `clang-omp` for supporting OpenMP without using `gcc`?
  36. **Solution 1**: it is not support and may have linking errors.