简体   繁体   中英

Trouble installing xgboost on Anaconda

I have tried doing a pip install of xgboost and was unsuccessful due to the firewall setting on my company computer.

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002000411CD48>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/xgboost/

I have tried downloading a xgboost 0.90 package from the following site: https://anaconda.org/anaconda/py-xgboost/files and did a conda install of it. No errors were produced during the installation process. When I tried importing it, there was an error.

Traceback (most recent call last):

  File "C:\Users\abcd\Documents\Python Scripts\test manual installations.py", line 10, in <module>
    from xgboost import XGBClassifier, plot_importance

  File "C:\ProgramData\Anaconda3\lib\site-packages\xgboost\__init__.py", line 11, in <module>
    from .core import DMatrix, Booster

  File "C:\ProgramData\Anaconda3\lib\site-packages\xgboost\core.py", line 161, in <module>
    _LIB = _load_lib()

  File "C:\ProgramData\Anaconda3\lib\site-packages\xgboost\core.py", line 123, in _load_lib
    lib_paths = find_lib_path()

  File "C:\ProgramData\Anaconda3\lib\site-packages\xgboost\libpath.py", line 52, in find_lib_path
    'List of candidates:\n' + ('\n'.join(dll_path)))

XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path?
List of candidates:
C:\ProgramData\Anaconda3\Library\mingw-w64\bin\xgboost.dll
C:\ProgramData\Anaconda3\lib\site-packages\xgboost\../../windows/x64/Release/xgboost.dll
C:\ProgramData\Anaconda3\lib\site-packages\xgboost\./windows/x64/Release/xgboost.dll

Would appreciate any help on how to solve the error from the traceback. Or other alternatives to install xgboost that would not involve a pip install. Thanks.

I ended up downloading the xgboost whl file from the following website: https://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost and ran a pip install of it. Seems to be working now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM