使用 pipenv 时的依赖问题

dependency issue when using pipenv

我是 Python 新手,在理解依赖关系方面遇到了一些困难,希望有人能提供帮助。

我正在使用 pipenv 设置开发环境。这是我的 pipenv 文件

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]
pytest = "*"
apache-airflow = "*"

[requires]
python_version = "2.7"

当我发出 pipenv install --dev 时,会发生这种情况:

$ pipenv install --dev
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.
Pipfile.lock not found, creating… Locking [dev-packages] dependencies…

Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Could not find a version that matches Flask-Login<0.5,==0.2.11,>=0.3
Tried: 0.1.1, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.2.8, 0.2.9, 0.2.10, 0.2.11, 0.3.0, 0.3.1, 0.3.2, 0.4.0, 0.4.0, 0.4.1

我按照它的建议做了:pipenv install --dev --skip-lock 成功完成:

$ pipenv install --dev --skip-lock
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.
Installing dependencies from Pipfile…
▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 2/2 — 00:00:02

然后 pipenv graph | grep Flask-Login

$ pipenv graph | grep Flask-Login
- Flask-Login [required: <0.5,>=0.3, installed: 0.2.11]

此时我有点困惑。我不知道为什么它可能安装了 Flask-Login 0.2.11,因为在依赖关系图中(似乎)没有其他东西需要 Flask-Login。

我很困惑。求助!

看来我在 pipenv 中遇到了一个已知问题:https://github.com/pypa/pipenv/issues/2596 and I'm not the only person to hit it when installing airflow: https://github.com/pypa/pipenv/issues/2596#issuecomment-427389166

将等待该问题是否得到解决。