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.