【问题标题】:module on test.pypi can't install dependencies, even though they exist [duplicate]test.pypi 上的模块无法安装依赖项,即使它们存在 [重复]
【发布时间】:2020-07-07 03:11:54
【问题描述】:

我已经完成了我想在我的社区中分发的这个小程序包。它现在在 test.pypi 上,当我想尝试安装它时,它给出了一个找不到依赖项的错误。

setup.py

...
install_requires=[
    'defcon>=0.6.0',
    'fonttools>=3.31.0'
]
...

抛出此错误

ERROR: Could not find a version that satisfies the requirement defcon>=0.6.0 (from sameWidther==0.6) (from versions: none)
ERROR: No matching distribution found for defcon>=0.6.0 (from sameWidther==0.6)

但是当我手动安装时,它可以工作

pip install 'fonttools>=3.6.0'
pip install 'defcon>=0.6.0'

【问题讨论】:

  • 您安装了不同的 Python 解释器。使用python -V验证版本
  • @TinNguyen 是的,我还有更多,使用pyenv pip 链接正确。问题是,为什么 pip 不能扇出依赖项,但是当我单独键入命令时可以安装它们?
  • 您所指的pip 被另一个python 解释器使用。 python -m pip install 'fonttools>=3.6.0'。尝试找到正确的python解释器python -Vpython3 -Vpy -Vpy3 -V。或者使用其完整路径调用 python。您可以在 windows 上使用 where python 和在 linux 上使用 which python 获取当前 python 的路径
  • @TinNguyen 我拥有的所有点子都可以手动安装这两个模块。您认为在该模块上运行 pip install 会调用 f.e. python2 的 pip 并尝试安装那些不适用于 python2 的包?它们实际上可供它们使用,并且 python2 的 pip 安装了它们。
  • 如何通过 TestPyPI 索引 URL?您可能正在覆盖 PyPI 索引。

标签: python setuptools pypi


【解决方案1】:

-i URL--index-url URL 表示“使用 URL 以独占方式安装包”。通过传递-i https://test.pypi.org/simple/,您将禁止从 PyPI (https://pypi.org/simple) 搜索和下载包。要同时使用这两个索引,请使用--extra-index-url

$ python -m pip install --extra-index-url https://test.pypi.org/simple/ sameWidther

【讨论】:

    猜你喜欢
    • 2020-10-30
    • 2022-08-24
    • 2021-09-13
    • 1970-01-01
    • 2021-11-29
    • 2012-10-04
    • 1970-01-01
    • 2016-09-16
    • 2013-08-26
    相关资源
    最近更新 更多