【问题标题】:Unable to install using pip install requirements.txt [closed]无法使用 pip install requirements.txt 安装 [关闭]
【发布时间】:2017-08-10 03:17:07
【问题描述】:

我正在尝试使用 requirements.txt 为 Python 2.7 安装 BitTornado,我收到以下错误:

Collecting requirements.txt
  Could not find a version that satisfies the requirement requirements.txt (from versions: )
No matching distribution found for requirements.txt

这是我在 requirements.txt 中的代码:

-e git+https://github.com/effigies/BitTornado.git#egg=python2.7

我也试过 -e git+https://github.com/effigies/BitTornado.git@python2.7 但还是不行。有人知道为什么会这样吗?

注意:“python2.7”是分支名称

提前致谢

【问题讨论】:

  • 请显示您运行的确切 pip 命令。
  • 它是“pip install requirements.txt”
  • pip install -r requirements.txt
  • 谢谢@mic4ael。我不知道我怎么错过了 -r 参数!

标签: python python-2.7 pip requirements.txt


【解决方案1】:

您忘记添加 -r 开关以指定 requirements.txt 是您的依赖项的文件。

【讨论】:

    【解决方案2】:

    正确的命令是pip install -r requirements.txt。注意-r 选项;没有它,pip 认为你要安装一个名为 requirements.txt 的包,但它并不存在。

    【讨论】:

    • 感谢@jwodder,使用 -r 选项,它说找不到 git 命令。这是否意味着我必须在我的系统上安装 git,没有它就无法安装?
    • @AvdheshParasha:是的。
    • 有没有其他方法可以安装 git 托管库而无需使用命令 git clone ....。我还在 setup.py 中尝试了dependency_links,但现在已弃用。
    • @AvdheshParasha:转到github.com/effigies/BitTornado,点击“克隆或下载”,点击“下载ZIP”,然后运行pip install /path/to/zip/file/you/just/downloaded
    • 谢谢@jwodder,我已经这样做了,但我想使用代码而不是手动安装它
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-19
    • 2020-01-11
    • 2015-12-17
    • 2019-10-14
    • 2016-04-29
    • 1970-01-01
    • 2023-01-16
    相关资源
    最近更新 更多