Idempotent "pip uninstall"
See original GitHub issueIf 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:
- Created 8 years ago
- Reactions:9
- Comments:24 (11 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
I would very much like an
--ignore-missingparameter forpip uninstall. This would be very handy for scripts that want to ensure that packages are in a known state.