Given that a Pipfile exists, it seems that both would install all dependencies from the Pipfile, and update Pipfile.lock. So, what is the difference?
What's the difference between `pipenv install` and `pipenv lock`?
4k Views Asked by Konstantin At
2
There are 2 best solutions below
0
On
pipenv lock generates a consistent set of dependencies from Pipfile and writes that to Pipfile.lock. It doesn't change the installed packages.
pipenv install with no arguments would generate the same set of dependencies and install them into the virtualenv.
I find the Pipenv documentation unclear.
You can have the details in the documentation: https://pipenv.readthedocs.io/en/latest/basics
Basically
pipenv installinstalls all the packages in the environment, whereaspipenv lockcreates the pipenv.lock file depending on what is already installed (even if you initialized your environment with a requirements.txt file using pip)If your folder is empty the effect will indeed be the same: the initialization of a pipenv environment with the default packages