找不到满足要求的版本pyyaml>=5.3,但是PyYAML是5.3.1版本

Could not find a version that satisfies the requirement pyyaml>=5.3, but PyYAML is version 5.3.1

我正在使用 SetupTools 构建 package of my own。在 setup.py 中的 INSTALL_REQUIRES 中,我有以下依赖项:

...
INSTALL_REQUIRES = [
    'ray>=0.8.7',
    'pyyaml>=5.3',
]

setup(name=PACKAGE_NAME,
      version=VERSION,
      description=DESCRIPTION,
      long_description=LONG_DESCRIPTION,
      long_description_content_type=LONG_DESC_TYPE,
      author=AUTHOR,
      license=LICENSE,
      author_email=AUTHOR_EMAIL,
      url=URL,
      install_requires=INSTALL_REQUIRES,
      packages=find_packages()
      )

当我 运行 pip3 install -i https://test.pypi.org/simple/ r3po==0.0.6 时,出现以下错误:

ERROR: Could not find a version that satisfies the requirement pyyaml>=5.3 (from r3po==0.0.6) (from versions: 3.11)
ERROR: No matching distribution found for pyyaml>=5.3 (from r3po==0.0.6)

但是,pip3 search pyyaml 告诉我 PyYAML 肯定存在:

PyYAML (5.3.1) - YAML parser and emitter for Python

pip3 install pyyaml(在安装了pyyaml.venv中)给出

Requirement already satisfied: pyyaml in /home/lieu/dev/inzura-clustering-project/.venv/lib/python3.8/site-packages (5.3.1)

在你问之前 --- 是的,我已经尝试了 PyYAMLpyyaml5.3.15.3 等的所有组合,但是没有任何效果。 我什至试图删除版本要求(所以 INSTALL_REQUIRES=['ray>=0.87','pyyaml'])但这会导致另一个错误:

ERROR: Command errored out with exit status 1:
command: /home/lieu/dev/r3po/sample/.venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-w32z04mo/pyyaml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-w32z04mo/pyyaml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-w32z04mo/pyyaml/pip-egg-info
         cwd: /tmp/pip-install-w32z04mo/pyyaml/
    Complete output (7 lines):
    running egg_info
    creating /tmp/pip-install-w32z04mo/pyyaml/pip-egg-info/PyYAML.egg-info
    writing /tmp/pip-install-w32z04mo/pyyaml/pip-egg-info/PyYAML.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-install-w32z04mo/pyyaml/pip-egg-info/PyYAML.egg-info/dependency_links.txt
    writing top-level names to /tmp/pip-install-w32z04mo/pyyaml/pip-egg-info/PyYAML.egg-info/top_level.txt
    writing manifest file '/tmp/pip-install-w32z04mo/pyyaml/pip-egg-info/PyYAML.egg-info/SOURCES.txt'
    error: package directory 'lib3/yaml' does not exist

Anthony Sottile 使用 --extra-index-url 的建议对我有用。