![](/img/trans.png)
[英]RuntimeError: Python version >= 3.5 required while installing the python libraries
[英]RuntimeError: Python version 2.7 or 3.4+ is required even if I already have 3.10.6 version
我正在按照 Ubuntu 22.04 上LabelPC 的 GitHub 頁面中的指南中的說明運行安裝程序,但出現以下錯誤:
Collecting absl-py==0.8.0
Using cached absl-py-0.8.0.tar.gz (102 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 "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-_yo1tcdy/absl-py_761c46388aa14bfaac46b6c57352037a/setup.py", line 34, in <module>
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.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
我不知道如何修復它,因為所有內容都已更新。 我的Python版本是3.10.6
這是abseil-py
中的錯誤。 Release 0.8 以這種方式進行 Python 版本比較。 該比較對於 Python 3.9 及以下的版本工作得很好,但在 3.10+ 時失敗了。 當py_version
為('3', '10')
時,比較返回False
因為在 Python 中'10'
小於'4'
; 對於字符串 Python 比較'1'
和'4'
。 (整數10
當然是 > 4
)。
該錯誤已在提交d61b0b6中修復。 不幸的是labelpc
需要准確的 0.8 版本。 這意味着現在 abseil abseil-py
和labelpc
可以與 Python 2.7 和 3.5-3.9 一起使用,但不能與 3.10+ 一起使用。
使用 Python 3.9 並報告錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.