python使用pip安装lightgbm报错解决

pip安装默认版本是最新的版本太高了,需要降低版本:pip install "lightgbm==2.3.1"

ubuntu下报错信息:

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting lightgbm
  Downloading http://mirrors.aliyun.com/pypi/packages/7a/6d/db0f5effd3f7982632111f37fcd2fa386b8407f1ff58ef30b71d65e1a444/lightgbm-3.2.1.tar.gz (1.5MB)
     |████████████████████████████████| 1.5MB 232kB/s 

ERROR: Command errored out with exit status 1:
     command: /home/yinchen/anaconda3/envs/python27new/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wNQXHB/lightgbm/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wNQXHB/lightgbm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-wNQXHB/lightgbm/pip-egg-info
         cwd: /tmp/pip-install-wNQXHB/lightgbm/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-wNQXHB/lightgbm/setup.py", line 43
        logger.info(f"Installing lib_lightgbm from: {LIB_PATH}")
                                                              ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
 

window下报错信息:

    ERROR: Command errored out with exit status 1:
     command: 'c:\users\72666\appdata\local\continuum\anaconda3\envs\python27new\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\72666\\appdata\\local\\temp\\pip-install-ohrfhv\\lightgbm\\setup.py'"'"'; __file__='"'"'c:\\users\\72666\\appdata\\local\\temp\\pip-install-ohrfhv\\lightgbm\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'c:\users\72666\appdata\local\temp\pip-pip-egg-info-oilnu4'
         cwd: c:\users\72666\appdata\local\temp\pip-install-ohrfhv\lightgbm\
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\72666\appdata\local\temp\pip-install-ohrfhv\lightgbm\setup.py", line 38
        def find_lib() -> List[str]:
                       ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

感谢:lightgbm 安装报错解决_wangwangstone的博客-CSDN博客

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值