darkavenger
darkavenger

Reputation: 715

Pipenv - Pipfile.lock - Difference when updated automatically compared to updated using `lock` command?

I read online that Pipfile is always updated automatically whenever a new package is installed/uninstalled/updated.

But I noticed that Pipfile.lock is also updated automatically. Then what difference does it make to Pipfile.lock when it is updated automatically compared to updated using lock command?

Upvotes: 2

Views: 2910

Answers (2)

Konstantin
Konstantin

Reputation: 2629

pipenv lock doesn't install anything. It just updates Pipfile.lock from Pipfile. pipenv install does two things. It installs and updates Pipfile.lock.

You might want to create a Pipfile.lock for example for initializing an environment in a Docker container or for your cloud-based environment, without installing anything locally.

Upvotes: 1

Sewagodimo Matlapeng
Sewagodimo Matlapeng

Reputation: 2326

You run pipenv lock to generate the pipfile.lock file initially,

It's important for projects that are moving from pip to pipenv. The command allows them to create a pipfile.lock with all the packages int heir project environment.

pipenv lock --keep-outdated

Keeps all the pinned packages in your requirements file to their pinned packages.

Upvotes: 0

Related Questions