Tri Pham
Tri Pham

Reputation: 5

What happens if we cancel "pip install" in the middle of installation?

When installing packages using pip (e.g., pip install -r requirements.txt), what happens if we cancel the process in the middle of the installation? Does pip automatically rollback to the state before the installation started?

Upvotes: 0

Views: 73

Answers (1)

Mikhail Kopochinskiy
Mikhail Kopochinskiy

Reputation: 26

If the process of installing packages using pip (e.g. via the command pip install -r requirements.txt) is interrupted in the middle of execution, pip does not automatically roll back to the state before the installation began.

Already installed packages will remain in place: if any package was installed before the interruption, it will remain installed.

So if an error occurred or you manually interrupted the installation, just enter the command again.

pip install -r requirements.txt  # pip will only attempt to install packages that are not fully installed

Upvotes: 0

Related Questions