abseil / abseil-py

Abseil Common Libraries (Python)
Apache License 2.0
2.27k stars 246 forks source link

Fails to install absl-py in PY3.11 in windows10 #208

Closed RESDXChgfore9hing closed 1 year ago

RESDXChgfore9hing commented 1 year ago

Collecting absl-py==0.9.0 Using cached absl-py-0.9.0.tar.gz (104 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "........\Temp\pip-install-e206df7y\absl-py_f01d251932dc4deea1b68decd3bf5167\setup.py", line 34, in raise RuntimeError('Python version 2.7 or 3.4+ is required.') RuntimeError: Python version 2.7 or 3.4+ is required. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

python --version Python 3.11.1

Its definitely 3.4+

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

RESDXChgfore9hing commented 1 year ago

this error happened when trying to install https://github.com/Ciphey/Ciphey which could be a blocking issue for https://github.com/Ciphey/Ciphey/issues/763

gpshead commented 1 year ago

the older code emitting that error is

py_version = sys.version_info
if py_version < (2, 7) or py_version[0] == 3 and py_version < (3, 4):
  raise RuntimeError('Python version 2.7 or 3.4+ is required.')

(see https://github.com/abseil/abseil-py/commit/accabc2cdc7a4db7d32850ea67f14b22db0957a9)

which isn't going to fail on 3.11 so whatever you were running was not actually running on 3.11...

yilei commented 1 year ago

It's installing absl-py 0.9.0, which had a bug for Python 3.10+ where the version check fails.

This was fixed in 0.12.0 with https://github.com/abseil/abseil-py/commit/d61b0b6bda1902f645e5bbbc3f138c142767befa.