使用flatpak-pip-generator编译时导致“错误:找不到版本”

问题描述

完整的日志如下所示。我在 requirements.txt 中使用 flatpak-pip-generator 。不使用需求文件,我会得到相同的错误。 (在编译项目时出现错误

  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-myezehl4/overlay --no-warn-script-location --no-binary :none: --only-binary :none: --no-index --find-links file:///run/build/python3-numpy -- 'setuptools<49.2.0' wheel 'Cython>=0.29.21'
       cwd: None
  Complete output (3 lines):
  Looking in links: file:///run/build/python3-numpy
  ERROR: Could not find a version that satisfies the requirement setuptools<49.2.0 (from versions: none)
  ERROR: No matching distribution found for setuptools<49.2.0
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-myezehl4/overlay --no-warn-script-location --no-binary :none: --only-binary :none: --no-index --find-links file:///run/build/python3-numpy -- 'setuptools<49.2.0' wheel 'Cython>=0.29.21' Check the logs for full command output.

解决方法

我已经通过锁定特定版本的python依赖关系解决了我的问题(奇怪的是,如果我使用flatpak-pip-generator,它只能以这种方式对我起作用)。我还使用了cppy,因为显然matplotlib依赖于cppy,尽管似乎在依赖关系轮中未明确声明。我的 requirements.txt 文件现在是:

numpy==1.17.3
# matplotlib implicitly requires cppy
cppy==1.1.0
matplotlib==3.1.1
sympy==1.6.2