我是一个 Python 新手,在理解依赖关系方面遇到了一些困难,希望有人能提供帮助。
我正在使用 pipelinev 来设置开发环境。这是我的 pipelinev 文件
[[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 图 | grep Flask-登录
$ pipenv graph | grep Flask-Login
- Flask-Login [required: <0.5,>=0.3, installed: 0.2.11]
此时我有点困惑。我不知道为什么它可能安装了 Flask-Login 0.2.11,因为依赖关系图中(似乎)没有其他内容需要 Flask-Login。
我很困惑。救命!
最佳答案
看起来我在 pipelinev 中遇到了一个已知问题:https://github.com/pypa/pipenv/issues/2596我并不是唯一一个在安装气流时遇到这个问题的人:https://github.com/pypa/pipenv/issues/2596#issuecomment-427389166
将等待查看该问题是否得到解决。
关于python - 使用pipenv时的依赖问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52667854/