オペレーティングシステム:Windows 7
コンパイラ:MSVC ++ 12(Visual Studio 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」を設定してから、「pythonsetup.pyinstall」を正常に実行します。 最後に、「import xgboostasxgb」は正しいです。 ただし、デモを実行すると、エラーが再び発生しました。
最後にファイルをクリーンアップしてから、xgboostを再構築します。 python installを実行すると、問題ありません。
2016年12月31日:
xgboostをcentos7 x86_64にインストールすると、このエラーが再び発生しました。 しかし、xgboostを再コンパイルし、Pythonのインストールに失敗しました。
makeまたはcmakeをコンパイルしてみますが、どちらも問題ありません。 しかし、Pythonをインストールして同じエラーが発生した場合。
バージョンのせいで、centos7ではなぜそれが良くないのか疑問に思います。
@anddelu include_package_data=False
は、パッケージのメンテナンスにMANIFEST.in
を使用し、パスではなくインストールにのみ影響するため、必須です。 xgboostを再構築する最後のステップは、 include_package_data=False
をそのままにしておくべき正しい解決策だと思います。
Anaconda Python3.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」を設定してから、「pythonsetup.pyinstall」を正常に実行します。 最後に、「import xgboostasxgb」は正しいです。 ただし、デモを実行すると、エラーが再び発生しました。
最後にファイルをクリーンアップしてから、xgboostを再構築します。 python installを実行すると、問題ありません。
2016年12月31日:
xgboostをcentos7 x86_64にインストールすると、このエラーが再び発生しました。 しかし、xgboostを再コンパイルし、Pythonのインストールに失敗しました。
makeまたはcmakeをコンパイルしてみますが、どちらも問題ありません。 しかし、Pythonをインストールして同じエラーが発生した場合。
バージョンのせいで、centos7ではなぜそれが良くないのか疑問に思います。