4

I'm having a variety of problems with my pipenv setup (another question here differences between users even after using Pipfile and Pipfile.lock with explicit versions) and I just noticed something else that seems funky.

It turns out in my project folder (with both a Pipfile and Pipfile lock created, with an initial pipenv install having been run, and without pipenv shell invoked), I can run pipenv install as many times as I want and every time it says that it is installing 74 dependencies. Does this mean that the pipenv install isn't taking effect, or does it just mean it's running through the dependencies to make sure they are installed?

It seems like there might be a problem, because when I open Pycharm for the project for that folder, it gives me the below alert ("Package requirements..." with the option to install requirements from Pipfile.lock).

I'm on the latest Pycharm which is setup to use the pipenv environment that I created with pipenv install, and I can confirm that it's using that environment based on Pycharm->Preferences->Project->Project Interpreter where it shows that it's using the right virtualenv for this folder.

But it seems that both pipenv install and Pycharm don't think the dependencies have been installed.

enter image description here

Stephen
  • 8,508
  • 12
  • 56
  • 96
  • This looks like a duplicate of [this question](https://stackoverflow.com/questions/55306431/pycharm-warns-package-requirement-not-satisfied-when-using-pipenv-to-install-pac/55341896#55341896). This is a major bug in PyCharm that hasn't yet been resolved, so you can go to that question and follow the link to vote for the ticket. – Mihai Chelaru Apr 30 '19 at 19:49
  • Ok. But the question about why `pipenv install` keeps installing 74 packages each time stands on its own, too. Should I be worried about that? Shouldn't it just install 0 packages the second time if I'm up to date? – Stephen Apr 30 '19 at 20:00
  • Also in my case it doesn't look like that workaround is solving my problem with Pycharm, but my greater concern is just the `pipenv install` side of things. – Stephen Apr 30 '19 at 20:08
  • I'm really not sure. The workaround I thought would help, but I think someone from JetBrains answered that this is actually a bug, so it doesn't seem to solve anything. Strangely enough I don't have this issue with pipenv. Did you create the project initially using pipenv as the interpreter? – Mihai Chelaru Apr 30 '19 at 20:14
  • I can't remember how I created it, but I definitely set pipenv as the interpreter early on, or it was automatic. Anyway it isn't really affecting anything so I'll probably just ignore it for now. My other question on the other hand is much more problematic for us. Thanks for your help. BTW Jetbrains seems to release a fair amount of bugs, it's one thing that's holding me back from paying for it. – Stephen Apr 30 '19 at 20:18

1 Answers1

2

To answer your second question, the requirements are not being installed again. Every time you run pipenv install it will say that it's installing all requirements from your Pipfile.lock file, but if you run pipenv install -v to make it verbose and see the output, you'll see things like the following:

Installed version (4.1.2) is most up-to-date (past versions: 4.1.2)
Requirement already up-to-date: whitenoise==4.1.2 in c:\users\mihai\.virtualenvs\pipenvtest-1zyry8jn\lib\site-packages (from -r C:\Users\Mihai\AppData\Local\Temp\pipenv-1th31ie1-requirements\pipenv-r4e3zcr7-requirement.txt (line 1))
 (4.1.2)
  Since it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.
Cleaning up...
Removed build tracker 'C:\\Users\\Mihai\\AppData\\Local\\Temp\\pip-req-tracker-ip_gjf7h'

So to answer your question, it just runs through them to check if they're installed, installing them only if necessary.

Mihai Chelaru
  • 7,614
  • 14
  • 45
  • 51