2017-01-04 8 views
1

virtualenvの下で、official installation guideを使用してPythonラッパーをインストールしようとしています。 setup.pyから、この記事ではhttps://stackoverflow.com/a/41061466男助言削除"include_package_data=True"macOS virtualenvでxgboost python wrapperを正しくインストールするには?

Install libxgboost from: ['/Users/dmitry/dev/mlenv/xgboost/xgboost/python-package/xgboost/../../lib/libxgboost.so'] 
running install 
running bdist_egg 
running egg_info 
creating xgboost.egg-info 
writing xgboost.egg-info/PKG-INFO 
writing dependency_links to xgboost.egg-info/dependency_links.txt 
writing requirements to xgboost.egg-info/requires.txt 
writing top-level names to xgboost.egg-info/top_level.txt 
writing manifest file 'xgboost.egg-info/SOURCES.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.macosx-10.12-x86_64/egg 
running install_lib 
running build_py 
creating build 
creating build/lib 
creating build/lib/xgboost 
copying xgboost/__init__.py -> build/lib/xgboost 
copying xgboost/callback.py -> build/lib/xgboost 
copying xgboost/compat.py -> build/lib/xgboost 
copying xgboost/core.py -> build/lib/xgboost 
copying xgboost/libpath.py -> build/lib/xgboost 
copying xgboost/plotting.py -> build/lib/xgboost 
copying xgboost/rabit.py -> build/lib/xgboost 
copying xgboost/sklearn.py -> build/lib/xgboost 
copying xgboost/training.py -> build/lib/xgboost 
error: Error: setup script specifies an absolute path: 

    /Users/dmitry/dev/mlenv/xgboost/xgboost/python-package/xgboost/../../lib/libxgboost.so 

setup() arguments must *always* be /-separated paths relative to the 
setup.py directory, *never* absolute paths. 

:私は

sudo python setup.py install 

をしたとき、私はエラーを得ました。私はそれをして、xgboostが正常にインストールされた、すなわちpython -c "import xgboost; print(xgboost.__version__)"は0.6を出力する。私はxgboost_root_dir/python-package/異なるフォルダにそれを実行したときに

それにもかかわらず、私が取得:

python -c "import xgboost; print(xgboost.__version__)" 
Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    File "/Users/dmitry/dev/mlenv/lib/python3.6/site-packages/xgboost-0.6-py3.6.egg/xgboost/__init__.py", line 21, in <module> 
    with open(VERSION_FILE) as f: 
FileNotFoundError: [Errno 2] No such file or directory: '/Users/dmitry/dev/mlenv/lib/python3.6/site-packages/xgboost-0.6-py3.6.egg/xgboost/VERSION' 

この問題を解決する方法は?

答えて

0

、私がやった:

import sys 
sys.path.append('<your-path-here>/xgboost/python-package') 
-2

これらの行をコメントするだけで、正常に動作します。回避策として

+0

私はどの行をコメントアウトする必要がありますか? – 0x1337

+0

エラーログに間違った行が表示されています – simon

関連する問題