Pycharm warns package requirement not satisfied when using pipenv to install package

Mat*_*hew 4 python django pycharm python-3.x pipenv

I am trying to install packages into my Pycharm environment using pipenv. However, when I use pipenv install <package name>, a popup appears on the top mentioning

"Package requirement not satisfied"

and asks me to "install requirements from Pipfile.lock"

When I started the project, I selected Pipenv as my project interpreter.Why is PyCharm asking to re-install a package from the Pipfile.lock file when I clearly used pipenv from the beginning and set the project to use Pipenv as an interpreter. Am I double installing ?

在此处输入图片说明

在此处输入图片说明

Update:

It is now reported as a bug in PyCharm, please vote for the issue:

https://youtrack.jetbrains.com/issue/PY-34622

Mih*_*aru 5

解决方案在JetBrains支持论坛上的此答案中。

步骤如下:

  1. 转到文件>使缓存无效/重新启动...,然后按无效并重新启动。
  2. 重新启动后,重新添加解释器,等待重建存根,然后检查问题是否已解决。
  3. 如果不是,那么首先通过转到文件>设置>项目:>项目解释器,并将项目解释器设置为No Interpreter,删除pipenv解释器作为项目解释器。单击应用,然后单击确定。然后重复步骤1和2,看看是否可以解决问题。

我不确定为什么会发生此问题,但似乎可以解决。

编辑07/29/19:

此错误已在PyCharm的2019.2版本中修复。

  • 在 2020.3 上仍然遇到此问题,使缓存无效/重新启动没有任何区别。 (3认同)