osama7901
osama7901

Reputation: 1671

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

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?.

Upvotes: 52

Views: 26208

Answers (2)

kravb
kravb

Reputation: 558

Per documentation (https://pipenv-fork.readthedocs.io/en/latest/advanced.html#using-pipenv-for-deployments), sync should be used to install versioned project dependencies. As stated by Jeffrey above, sync is a much cleaner approach and will not attempt to modify your lock file.

Upvotes: 0

Jeffrey Harmon
Jeffrey Harmon

Reputation: 2437

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.

Upvotes: 67

Related Questions