2017-01-04 1 views
1

virtualenv에서 official installation guide을 사용하여 python wrapper를 설치하려고합니다. 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