Search code examples
pythonpipenvpipfile

What's the difference between `pipenv install` and `pipenv lock`?


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?


Solution

  • You can have the details in the documentation: https://pipenv.readthedocs.io/en/latest/basics

    Basically pipenv install installs all the packages in the environment, whereas pipenv lock creates 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