微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

解决python包依赖关系

如何解决解决python包依赖关系

我试图锁定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 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 --support来解决。 原来pipenv使用的是python3。因此必须使用以下命令将其明确指向python2,这确实创建了Pipfile.lock

pipenv --two install

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。