You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the keyword argument python_requires of setup() is not set, and thus it is assumed that this distribution is compatible with all Python versions.
However, I found it is not compatible with Python 2. My local Python version is 2.7, and I encounter the following error when executing “pip install lightgbm”
Collecting lightgbm
Downloading lightgbm-3.3.2.tar.gz (1.5 MB)
|████████████████████████████████| 1.5 MB 233 kB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-O0hSCR/lightgbm/setup.py'"'"'; __file__='"'"'/tmp/pip-install-O0hSCR/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-pip-egg-info-TZ3SVN
cwd: /tmp/pip-install-O0hSCR/lightgbm/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-O0hSCR/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.
I noticed that setup.py used the syntax feature Type Hints. The feature is only compatible with Python 3, resulting in installation failure of lightgbm in Python 2.7.
Way to fix:
modify setup() in setup.py, add python_requires keyword argument:
setup(…
python_requires=">=3.5"
…)
Thanks for your attention.
Best regrads,
PyVCEchecker
The text was updated successfully, but these errors were encountered:
Thanks very much for using LightGBM and for the report, @PyVCEchecker !
We have historically resisted including a floor with python_requires, but I agree that in this case it would take significant effort to get the package working on Python 2.7, and from maintainers' perspective here lightgbm does not support Python 2 (as of #3581).
I'd support a pull request that adds `python_requires='>=3.5'. Would you like to submit one?
This issue has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
including a reference to this.
Description
Currently, the keyword argument python_requires of setup() is not set, and thus it is assumed that this distribution is compatible with all Python versions.
However, I found it is not compatible with Python 2. My local Python version is 2.7, and I encounter the following error when executing “pip install lightgbm”
I noticed that setup.py used the syntax feature Type Hints. The feature is only compatible with Python 3, resulting in installation failure of lightgbm in Python 2.7.
Way to fix:
modify setup() in setup.py, add python_requires keyword argument:
Thanks for your attention.
Best regrads,
PyVCEchecker
The text was updated successfully, but these errors were encountered: