Sistema operacional: Windows 7
Compilador: MSVC ++ 12 (Visual Studio 2013)
Pacote usado (python / R / jvm / C ++): Python 3.4.4
xgboost
versão usada: 0,6
Se estiver instalando da fonte, forneça
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.
Se você estiver usando o pacote python, forneça
xgboost
se você não estiver instalando da fonte - python.exe setup.py install
(via ferramentas de configuração)LIB_PATH = libpath['find_lib_path']()
LIB_PATH = ['../lib/libxgboost.dll']
Eu também encontrei este erro no centos 6.5 64. Eu procuro soluções e decido editar o python-package / setup.py.
Basta definir 38º "include_package_data = False" e executar "python setup.py install" com sucesso. Finalmente, "import xgboost as xgb" está correto. Apesar de executar a demonstração, encontrei erros novamente.
Finalmente, eu limpo os arquivos e reconstruo o xgboost novamente. Para executar a instalação do python e agora está tudo bem!
31-12-2016:
ao instalar o xgboost no centos 7 x86_64, encontrei este erro novamente. No entanto, recompilei o xgboost e não consegui instalar o python.
Eu tento make ou cmake para compilar, ambos ok. Mas quando eu instalo o python e encontro o mesmo erro.
Só me pergunto por que não é bom no centos 7, só por causa da versão.
@anddelu include_package_data=False
é obrigatório, pois usa MANIFEST.in
para a manutenção do pacote e isso afeta apenas a instalação, não o caminho. Acho que sua última etapa de reconstrução do xgboost é a solução certa, onde include_package_data=False
deve permanecer como está.
Eu estava tendo o mesmo erro no Linux executando o Anaconda Python 3.5.
Acho que consertei fazendo as seguintes modificações em 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
Comentários muito úteis
Eu também encontrei este erro no centos 6.5 64. Eu procuro soluções e decido editar o python-package / setup.py.
Basta definir 38º "include_package_data = False" e executar "python setup.py install" com sucesso. Finalmente, "import xgboost as xgb" está correto. Apesar de executar a demonstração, encontrei erros novamente.
Finalmente, eu limpo os arquivos e reconstruo o xgboost novamente. Para executar a instalação do python e agora está tudo bem!
31-12-2016:
ao instalar o xgboost no centos 7 x86_64, encontrei este erro novamente. No entanto, recompilei o xgboost e não consegui instalar o python.
Eu tento make ou cmake para compilar, ambos ok. Mas quando eu instalo o python e encontro o mesmo erro.
Só me pergunto por que não é bom no centos 7, só por causa da versão.