首页 > 解决方案 > pipenv 安装包失败

问题描述

我正在尝试从Pipfilewith安装软件包,pipenv但我不断收到错误,我不知道如何调试。

pip --version
pip 18.1

pipenv --version
version 2018.10.9

我得到的错误是:

pipenv install --dev --deploy

Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing dependencies from Pipfile.lock (917af8)…
An error occurred while installing backports-ssl-match-hostname==3.5.0.1 --hash=sha256:502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2! Will try again.
     ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 185/185 — 00:00:33
Installing initially failed dependencies…
Collecting backports-ssl-match-hostname==3.5.0.1 :00

  Could not find a version that satisfies the requirement backports-ssl-match-hostname==3.5.0.1 (from -r /tmp/pipenv-qlbc3amj-requirements/pipenv-akfm2pt_-requirement.txt (line 1)) (from versions: )
No matching distribution found for backports-ssl-match-hostname==3.5.0.1 (from -r /tmp/pipenv-qlbc3amj-requirements/pipenv-akfm2pt_-requirement.txt (line 1))

  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 00

查看Pipfile.lock我可以找到backports定义为的包:

   "backports.ssl-match-hostname": {
        "hashes": [
            "sha256:502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2"
        ],
        "version": "==3.5.0.1"
    },

使用详细标志运行所有内容,backports 包是一个依赖项,recurly它位于Pipfile

 recurly = ">=2.8.6"

标签: pippipenv

解决方案


当您的 pipenv 外壳处于活动状态时,将您的 pip 版本降级到 18.0.0

python -m pip install pip==18.0.0

它对我有用


推荐阅读