3

我在我的学校项目中使用开源 python 包“farm-Haystack”。当我requirements.txt在 python3.6 venv 中安装时,我收到了这个错误:

Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-t35n0vdx/uvloop_059c5c705acc434ab0515b073c3e079b/setup.py", line 5, in <module>
        raise RuntimeError('uvloop requires Python 3.7 or greater')
    RuntimeError: uvloop requires Python 3.7 or greater
    ----------------------------------------

显然,当我使用 python 3.6 时,这个包需要 python 3.7。我当时没有注意到此错误消息并继续使用该程序。程序编译成功并按预期运行。

当我向后滚动并找到消息时,我真的很好奇为什么仍然可以解决这种依赖关系。我可以uvloop通过查找pip freeze,也可以将其导入我的程序。uvloop我想知道如果与所需的 python 版本不匹配,可能会出现什么结果,因为我完全不熟悉这个包。

(希望不用升级python版本,花了我好长时间才让一切运行成功)

4

1 回答 1

1

It looks like one of the packages includes an unpinned dependency for uvloop.

Starting from uvloop 0.15.0 it requires Python 3.7 or greater.

To fix it need to freeze the version in requirements.txt:

...
uvloop==0.14.0
...
于 2021-04-25T03:20:23.830 回答