์ด์ ์ฒด์ : ์๋์ฐ 7
์ปดํ์ผ๋ฌ: MSVC++ 12(๋น์ฃผ์ผ ์คํ๋์ค 2013)
์ฌ์ฉ๋ ํจํค์ง(python/R/jvm/C++): Python 3.4.4
xgboost
์ฌ์ฉ๋ ๋ฒ์ : 0.6
์์ค์์ ์ค์นํ๋ ๊ฒฝ์ฐ ์ ๊ณตํ์ญ์์ค.
git rev-parse HEAD
): e7fbc8591fa7277ee4c474b7371c48c11b34cbdeInstall libxgboost from: ['C:\\Python34\\XGBoost\\python-package\\xgboost\\../..
/lib/libxgboost.dll']
running install
running bdist_egg
running egg_info
writing requirements to xgboost.egg-info\requires.txt
writing xgboost.egg-info\PKG-INFO
writing dependency_links to xgboost.egg-info\dependency_links.txt
writing top-level names to xgboost.egg-info\top_level.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.win-amd64\egg
running install_lib
running build_py
error: Error: setup script specifies an absolute path:
C:\Python34\XGBoost\python-package\xgboost\..\..\lib\libxgboost.dll
setup() arguments must *always* be /-separated paths relative to the
setup.py directory, *never* absolute paths.
python ํจํค์ง๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์ ๊ณตํ์ญ์์ค.
xgboost
๋ฅผ ์ค์นํ๋ ๋ช
๋ น - python.exe setup.py install
(setuptools๋ฅผ ํตํด)LIB_PATH = libpath['find_lib_path']()
LIB_PATH = ['../lib/libxgboost.dll']
๋๋ ๋ํ centos 6.5 64์์ ์ด ์ค๋ฅ๋ฅผ ๋ง๋ฌ์ต๋๋ค. ์๋ฃจ์
์ ๊ฒ์ํ๊ณ python-package/setup.py๋ฅผ ํธ์งํ๊ธฐ๋ก ๊ฒฐ์ ํ์ต๋๋ค.
38๋ฒ์งธ "include_package_data=False"๋ฅผ ์ค์ ํ ๋ค์ "python setup.py install"์ ์ฑ๊ณต์ ์ผ๋ก ์คํํฉ๋๋ค. ๋ง์ง๋ง์ผ๋ก "xgboost๋ฅผ xgb๋ก ๊ฐ์ ธ์ค๊ธฐ"๊ฐ ๋ง์ต๋๋ค. ๊ทธ๋ฌ๋ ๋ฐ๋ชจ๋ฅผ ์คํํ๋๋ฐ ๋ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
๋ง์ง๋ง์ผ๋ก ํ์ผ์ ์ ๋ฆฌํ ๋ค์ xgboost๋ฅผ ๋ค์ ๋น๋ํฉ๋๋ค. ํ์ด์ฌ ์ค์น๋ฅผ ์คํํ๋ ค๋ฉด ์ด์ ๊ด์ฐฎ์ต๋๋ค!
2016๋
12์ 31์ผ:
centos 7 x86_64์ xgboost๋ฅผ ์ค์นํ ๋ ์ด ์ค๋ฅ๊ฐ ๋ค์ ๋ฐ์ํ์ต๋๋ค. ๊ทธ๋ฌ๋ xgboost๋ฅผ ๋ค์ ์ปดํ์ผํ๊ณ python์ ์ค์นํ์ง ๋ชปํ์ต๋๋ค.
์ปดํ์ผ์ ์ํด make ๋๋ cmake๋ฅผ ์๋ํฉ๋๋ค. ๋ ๋ค ๊ด์ฐฎ์ต๋๋ค. ๊ทธ๋ฌ๋ ํ์ด์ฌ์ ์ค์นํ๊ณ ๊ฐ์ ์ค๋ฅ๋ฅผ ๋ง๋ฌ์ ๋.
๋๋ ๋จ์ง ๋ฒ์ ๋๋ฌธ์ centos 7์์ ์ข์ง ์์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค.
@anddelu include_package_data=False
๋ ํจํค์ง ์ ์ง ๊ด๋ฆฌ๋ฅผ ์ํด MANIFEST.in
๋ฅผ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ ํ์์ด๋ฉฐ ์ด๋ ๊ฒฝ๋ก๊ฐ ์๋ ์ค์น์๋ง ์ํฅ์ ๋ฏธ์นฉ๋๋ค. xgboost๋ฅผ ์ฌ๊ตฌ์ถํ๋ ๋ง์ง๋ง ๋จ๊ณ๋ include_package_data=False
๋ฅผ ๊ทธ๋๋ก ์ ์งํด์ผ ํ๋ ์ฌ๋ฐ๋ฅธ ์๋ฃจ์
์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.
Anaconda Python 3.5๋ฅผ ์คํํ๋ Linux์์ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
setup.py๋ฅผ ๋ค์๊ณผ ๊ฐ์ด ์์ ํ์ฌ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
diff --git a/python-package/setup.py b/python-package/setup.py
index 27fc212..ec9b806 100644
--- a/python-package/setup.py
+++ b/python-package/setup.py
@@ -7,7 +7,7 @@ from setuptools import setup, find_packages
# import subprocess
sys.path.insert(0, '.')
-CURRENT_DIR = os.path.dirname(__file__)
+CURRENT_DIR = os.path.abspath(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
@@ -17,6 +17,7 @@ libpath = {'__file__': libpath_py}
exec(compile(open(libpath_py, "rb").read(), libpath_py, 'exec'), libpath, libpath)
LIB_PATH = libpath['find_lib_path']()
+LIB_PATH = [os.path.relpath(LIB_PATH[0], CURRENT_DIR)]
print("Install libxgboost from: %s" % LIB_PATH)
# Please use setup_pip.py for generating and deploying pip installation
# detailed instruction in setup_pip.py
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋๋ ๋ํ centos 6.5 64์์ ์ด ์ค๋ฅ๋ฅผ ๋ง๋ฌ์ต๋๋ค. ์๋ฃจ์ ์ ๊ฒ์ํ๊ณ python-package/setup.py๋ฅผ ํธ์งํ๊ธฐ๋ก ๊ฒฐ์ ํ์ต๋๋ค.
38๋ฒ์งธ "include_package_data=False"๋ฅผ ์ค์ ํ ๋ค์ "python setup.py install"์ ์ฑ๊ณต์ ์ผ๋ก ์คํํฉ๋๋ค. ๋ง์ง๋ง์ผ๋ก "xgboost๋ฅผ xgb๋ก ๊ฐ์ ธ์ค๊ธฐ"๊ฐ ๋ง์ต๋๋ค. ๊ทธ๋ฌ๋ ๋ฐ๋ชจ๋ฅผ ์คํํ๋๋ฐ ๋ค์ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
๋ง์ง๋ง์ผ๋ก ํ์ผ์ ์ ๋ฆฌํ ๋ค์ xgboost๋ฅผ ๋ค์ ๋น๋ํฉ๋๋ค. ํ์ด์ฌ ์ค์น๋ฅผ ์คํํ๋ ค๋ฉด ์ด์ ๊ด์ฐฎ์ต๋๋ค!
2016๋ 12์ 31์ผ:
centos 7 x86_64์ xgboost๋ฅผ ์ค์นํ ๋ ์ด ์ค๋ฅ๊ฐ ๋ค์ ๋ฐ์ํ์ต๋๋ค. ๊ทธ๋ฌ๋ xgboost๋ฅผ ๋ค์ ์ปดํ์ผํ๊ณ python์ ์ค์นํ์ง ๋ชปํ์ต๋๋ค.
์ปดํ์ผ์ ์ํด make ๋๋ cmake๋ฅผ ์๋ํฉ๋๋ค. ๋ ๋ค ๊ด์ฐฎ์ต๋๋ค. ๊ทธ๋ฌ๋ ํ์ด์ฌ์ ์ค์นํ๊ณ ๊ฐ์ ์ค๋ฅ๋ฅผ ๋ง๋ฌ์ ๋.
๋๋ ๋จ์ง ๋ฒ์ ๋๋ฌธ์ centos 7์์ ์ข์ง ์์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค.