【问题标题】:Resolving python package dependencies解决python包依赖
【发布时间】:2020-12-11 03:53:19
【问题描述】:

我试图锁定 Pipfile 并遇到以下错误:

$pipenv install
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Building requirements...
Resolving dependencies...
✘ Locking Failed! 
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You 
likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original 
command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ 
pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: Could not find a version that matches pep8 (from -r 
/var/folders/k_/z7wqjx090x7ccf11mkbpbnw80000gn/T/pipenv7upqst3zrequirements/pipenv-DczZI5- 
constraints.txt (line 2))
No versions found
Was https://pypi.org/simple reachable?

尝试运行建议的命令,但还是一样。

pipenv lock --clear
Locking [dev-packages] dependencies…
Building requirements...
Resolving dependencies...
✘ Locking Failed! 
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You 
likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original 
command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ 
pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: Could not find a version that matches pep8 (from -r 
/var/folders/k_/z7wqjx090x7ccf11mkbpbnw80000gn/T/pipenv0s9lv_igrequirements/pipenv-G4Zdsv- 
constraints.txt (line 2))
No versions found
Was https://pypi.org/simple reachable?

【问题讨论】:

  • pipenv install --skip-lock 但是有效。但是我该如何生成 Pipfile.lock?

标签: python-2.7 pipenv pep8 pipfile


【解决方案1】:

没关系,使用 pipenv --support 解决了。 原来 pipenv 正在使用 python3。所以必须使用下面的命令明确地将它指向 python2 并且确实创建了 Pipfile.lock

pipenv --two install

【讨论】:

    猜你喜欢
    • 2011-04-05
    • 2019-01-03
    • 2012-05-20
    • 1970-01-01
    • 2021-01-06
    • 1970-01-01
    • 2011-04-01
    • 2023-03-13
    相关资源
    最近更新 更多