Xgboost: libpath ['find_lib_path'] () devuelve la ruta absoluta para libxgboost.dll en Windows; instalación falla

Creado en 7 dic. 2016  ·  3Comentarios  ·  Fuente: dmlc/xgboost

Información medioambiental

Sistema operativo: Windows 7

Compilador: MSVC ++ 12 (Visual Studio 2013)

Paquete utilizado (python / R / jvm / C ++): Python 3.4.4

xgboost versión utilizada: 0.6

Si está instalando desde la fuente, proporcione

  1. El hash de confirmación ( git rev-parse HEAD ): e7fbc8591fa7277ee4c474b7371c48c11b34cbde
  2. Registros:
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.

Si está utilizando el paquete de Python, proporcione

  1. La versión y distribución de Python: compilación oficial 3.4.4 para Win64
  2. El comando para instalar xgboost si no está instalando desde la fuente - python.exe setup.py install (a través de setuptools)

pasos para reproducir

  1. Descargar el código fuente de xgboost desde github
  2. mkdir build && cd build && cmake .. -G "Visual Studio 12 2013 Win64"
  3. Abra xgboost.sln con VS2013 y cree todas las soluciones con la configuración de lanzamiento, para la plataforma x64. Obtendrá la biblioteca lib / libxgboost.dll.
  4. cd ..python-package && python.exe setup.py install

¿Qué has probado?

  1. Reemplazar la ruta del archivo en el archivo SOURCES.txt: esto no tiene ningún efecto, porque este archivo se sobrescribe cada vez
  2. Cambie python-package / MANIFEST.in y excluya el directorio lib; esto no tiene ningún efecto, porque no hay una regla para el archivo .dll
  3. Reemplace python-package / setup.py, línea 19
    LIB_PATH = libpath['find_lib_path']()
    para
    LIB_PATH = ['../lib/libxgboost.dll']
    Ésta fue la solución.
    Por cierto, esto es un problema, y ​​el equipo de XGBoost tal vez lo resuelva de la manera adecuada.

Comentario más útil

También encontré este error en centos 6.5 64. Busco soluciones y decido editar el paquete python / setup.py.
Simplemente establezca 38º "include_package_data = False" y luego ejecuto "python setup.py install" con éxito. Finalmente, "importar xgboost como xgb" es correcto. Sin embargo, ejecuté la demostración, volví a encontrar errores.

Finalmente limpio los archivos y luego reconstruyo el xgboost nuevamente. ¡Para ejecutar la instalación de Python y ahora está bien!


31/12/2016:
cuando instalo xgboost en centos 7 x86_64, encontré este error nuevamente. Sin embargo, volví a compilar el xgboost y no pude instalar Python.
Intento compilar make o cmake, ambos están bien. Pero cuando instalo Python y encuentro el mismo error.
Me pregunto por qué no es bueno en centos 7, solo por la versión.

Todos 3 comentarios

También encontré este error en centos 6.5 64. Busco soluciones y decido editar el paquete python / setup.py.
Simplemente establezca 38º "include_package_data = False" y luego ejecuto "python setup.py install" con éxito. Finalmente, "importar xgboost como xgb" es correcto. Sin embargo, ejecuté la demostración, volví a encontrar errores.

Finalmente limpio los archivos y luego reconstruyo el xgboost nuevamente. ¡Para ejecutar la instalación de Python y ahora está bien!


31/12/2016:
cuando instalo xgboost en centos 7 x86_64, encontré este error nuevamente. Sin embargo, volví a compilar el xgboost y no pude instalar Python.
Intento compilar make o cmake, ambos están bien. Pero cuando instalo Python y encuentro el mismo error.
Me pregunto por qué no es bueno en centos 7, solo por la versión.

@anddelu include_package_data=False es imprescindible ya que usa MANIFEST.in para el mantenimiento del paquete y esto solo afecta la instalación, no la ruta. Creo que su último paso para reconstruir xgboost es la solución correcta donde include_package_data=False debería permanecer como está.

Me estaba encontrando con el mismo error en Linux con Anaconda Python 3.5.

Creo que lo arreglé haciendo las siguientes modificaciones en 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
¿Fue útil esta página
0 / 5 - 0 calificaciones