我正在 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
中的一个错误。 0.8 版本进行了 Python 版本比较这样。该比较对于 3.9 及以下版本的 Python 运行良好,但对于 3.10+ 版本则失败。当 py_version
为 ('3', '10')
时,比较返回 False
,因为在 Python 中 '10'
小于 '4'
;对于字符串,Python 比较 '1'
和 '4'
。 (整数 10
当然 > 4
)。
该错误已在提交d61b0b6中修复。不幸的是
labelpc
需要确切的版本0.8。这意味着目前 abseil-py
和 labelpc
可以与 Python 2.7 和 3.5-3.9 一起使用,但不能与 3.10+ 一起使用。
使用 Python 3.9 并报告错误。
如果无法恢复到 3.9,您可以使用
--ignore-requires-python
和 pip install
来解决该问题。它可能会产生其他意想不到的后果,因此请仔细测试。
较新的 Python 版本有一些问题,我猜当我安装一些模块时,Python 3.11 版本中出现了一些运行时错误。* 然后我使用以下命令解决了此错误。
PS P:\高塔姆 asa> python --版本 Python 3.10.10 PS P:\高塔姆 asa> python -m pip install rasa --use-deprecated=legacy-resolver