what are the advantages of using pipenv sync over pipenv install?

osama7901 picture osama7901 · Sep 21, 2018 · Viewed 7.4k times · Source

I am using pipenv to manage my python packages, in my repository, I have both Pipfile and Pipfile.lock versioned. and I want to install all python packages on my live server. should I use pipenv sync or pipenv install? and why?.

Answer

Jeffrey Harmon picture Jeffrey Harmon · Nov 26, 2018

From looking at the docs, it looks like pipenv install will install all dependencies from the pipfile, and update pipfile.lock with the versions it used. pipenv sync will install the exact versions specified in pipfile.lock.

I would say sync is better for getting your environment to match what is checked in, and install is for when you want to get the latest versions, or are adding new dependencies that aren't in the lock file yet.