【问题标题】:Can't verify hashes for these requirements because we don't have a way to hash version control repositories无法验证这些要求的哈希值,因为我们无法对版本控制存储库进行哈希处理
【发布时间】:2018-07-31 22:29:09
【问题描述】:

我有以下需求文件:

...
sqlalchemy==1.2.3 --hash=sha256:9e9ec143e2e246f385cfb2de8daa89d2fa466279addcb7be9e102988fdf33d24
werkzeug==0.14.1 --hash=sha256:d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b  
git+ssh://gitlab.domain.com/private_pkg.git#egg=private_pkg

从 shell 安装项目非常完美:

pip install git+ssh://gitlab.domain.com/private_pkg.git#egg=private_pkg

但尝试从需求文件安装它会引发此错误:

Can't verify hashes for these requirements because we don't have a way to hash version control repositories:
    private_pkg from git+ssh://gitlab.domain.com/private_pkg.git#egg=private_pkg (from -r requirements/prod.lock (line 30))

注意:从pipenv lock -r生成的需求文件中的哈希值

【问题讨论】:

    标签: python python-3.x pip python-packaging pipenv


    【解决方案1】:

    pip 中的--hash 选项是全有或全无。您要么不指定,要么需要指定所有这些。但是,未托管在 PyPI 上的包不能有哈希,这会导致失败。使用带有--hash 选项集的任何包安装您的项目,您就会看到问题所在。

    较新版本的 Pipenv 完全从导出的 requirements.txt 中删除了哈希值以避免该问题。

    【讨论】:

      猜你喜欢
      • 2019-12-14
      • 1970-01-01
      • 1970-01-01
      • 2021-06-18
      • 1970-01-01
      • 1970-01-01
      • 2012-12-30
      • 2018-06-18
      • 2018-12-27
      相关资源
      最近更新 更多