question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Idempotent "pip uninstall"

See original GitHub issue

If I run pip uninstall a b and a is installed but b is not the pip uninstall will error out and not uninstall b - as requested. I think this behavior is very surprising. Pip should maybe warn about packages that are already uninstalled?

IOW, if the goal of uninstall is to remove a package, then if the package is already removed then it’s a success. Why is it an error?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:9
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

8reactions
ssbarneacommented, Jun 28, 2017

My vote would be to change default return code and to return success if in the end the module is no longer installed. That’s real idempotency, not having to add an additional parameter to obtain that behaviour.

4reactions
dflockcommented, Apr 5, 2016

I would very much like an --ignore-missing parameter for pip uninstall. This would be very handy for scripts that want to ensure that packages are in a known state.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pip does not delete source after successful build
Basically I want my playbook to be idempotent. I can delete the destination folder prior to installation and that solves the problem, however...
Read more >
ensure-tox: make idempotent and update testing · b2d27969a9 ...
This role currently does which tox || pip install --user tox and then sets ... We are working to remove this assumption; remove...
Read more >
pipenv Documentation - Read the Docs
lock. • uninstall - Will remove the dependency. • lock - Regenerate Pipfile.lock and updates the dependencies inside it. These are intended to...
Read more >
Troubleshooting the installation | OpenStack Cloud ...
First remove the generated inventory files: rm -f /etc/openstack_deploy/openstack_inventory.json rm -f /etc/openstack_deploy/openstack_hostnames_ips.yml. Copy.
Read more >
Advanced Usage of Pipenv - Read the Docs
Pipenv will expand environment variables (if defined) in your Pipfile. ... This file defines a specific idempotent environment that is known to work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found