如何解决“错误:找不到与安装匹配的版本”?

时间:2019-02-02 15:05:27

标签: pipenv

我正在尝试使用pipenv安装django-crispy-forms。

安装它是因为当我运行“ pip Frozen”命令时,我看到了它。

何时该锁定[packages]依赖项...

它面临锁定,并且出现此错误。

[pipenv.exceptions.ResolutionFailure]:   File "c:/users/rapture c. 
godson/appdat
a/local/programs/python/python37-32/lib/site- 
packages/pipenv/resolver.py", line
69, in resolve
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "c:\users\rapture c. 
godson\appdat
a\local\programs\python\python37-32\lib\site-packages\pipenv\utils.py", 
line 726
, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "c:\users\rapture c. 
godson\appdat
a\local\programs\python\python37-32\lib\site-packages\pipenv\utils.py", 
line 480
, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = 
resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "c:\users\rapture c. 
godson\appdat
a\local\programs\python\python37-32\lib\site-packages\pipenv\utils.py", 
line 395
, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise 
ResolutionFailure(message=str
(e))
[pipenv.exceptions.ResolutionFailure]:       
pipenv.exceptions.ResolutionFailure
: ERROR: ERROR: Could not find a version that matches install
[pipenv.exceptions.ResolutionFailure]:       No versions found
[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: 
ERROR: Could not find a version that matches install
No versions found
Was https://pypi.org/simple reachable?

我尝试运行以下命令建议[pipenv install --skip-lock和pipenv install --skip-lock],但我仍然遇到相同的错误。

如何解决此问题,因为我想在Heroku上部署项目,但不知道这是否会阻止项目的部署?

1 个答案:

答案 0 :(得分:4)

尝试从pipfile中删除出现问题的库,请检查是否有错字。

pipevn install“ any-library”会将“ any-library”插入到pipfile中,即使它不存在,也可能是一个

错误原因,例如: $ pipenv安装任何库

错误:错误:找不到与任何库匹配的版本