Xgboost: libpath ['find_lib_path']()は、Windows上のlibxgboost.dllの絶対パスを返します。 セットアップのインストールが失敗する

作成日 2016年12月07日  ·  3コメント  ·  ソース: dmlc/xgboost

環境情報

オペレーティングシステム:Windows 7

コンパイラ:MSVC ++ 12(Visual Studio 2013)

使用したパッケージ(python / R / jvm / C ++):Python 3.4.4

xgboostバージョン:0.6

ソースからインストールする場合は、提供してください

  1. コミットハッシュ( git rev-parse HEAD ):e7fbc8591fa7277ee4c474b7371c48c11b34cbde
  2. ログ:
Install 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パッケージを使用している場合は、

  1. Pythonのバージョンとディストリビューション-3.4.4Win64の公式ビルド
  2. ソースからインストールしていない場合にxgboostをインストールするコマンド- python.exe setup.py install (setuptools経由)

再現する手順

  1. githubからxgboostのソースコードをダウンロードします
  2. mkdir build && cd build && cmake .. -G "Visual Studio 12 2013 Win64"
  3. VS2013でxgboost.slnを開き、x64プラットフォーム用のリリース構成ですべてのソリューションをビルドします。 lib /libxgboost.dllライブラリを取得します。
  4. cd ..python-package && python.exe setup.py install

何を試しましたか?

  1. SOURCES.txtファイルのファイルパスを置き換えます-これは効果がありません。このファイルは毎回上書きされます。
  2. python-package / MANIFEST.inを変更し、libディレクトリを除外します-これは効果がありません。.dllファイルのルールはありません。
  3. python-package / setup.py、19行目を置き換えます
    LIB_PATH = libpath['find_lib_path']()

    LIB_PATH = ['../lib/libxgboost.dll']
    これが解決策でした。
    ちなみに、これは問題であり、XGBoostチームはおそらくこれを適切な方法で解決するでしょう。

最も参考になるコメント

また、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ではなぜそれが良くないのか疑問に思います。

全てのコメント3件

また、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
このページは役に立ちましたか?
0 / 5 - 0 評価