Skip to content

Proposal: pipx clean/reset #1606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sigma67 opened this issue Feb 12, 2025 · 2 comments
Open

Proposal: pipx clean/reset #1606

sigma67 opened this issue Feb 12, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@sigma67
Copy link

sigma67 commented Feb 12, 2025

How would this feature be useful?

Pipx environment can become corrupted due to aborted installations (packages with missing metadata) or aborted shared upgrades.

Example error:

ModuleNotFoundError: No module named 'pip._internal.cli'

For this and other cases with corrupted metadata that are hard to recover from, it would be useful if pipx could reset itself to a first-installation state.

Describe the solution you'd like

Completely reset pipx to first installation state

Describe alternatives you've considered

Alternative is to manually delete pipx state. This is cumbersome however, as the location depends on the platform and each user needs to find out where it is located.

@powercoconola
Copy link

powercoconola commented Feb 28, 2025

as the location depends on the platform and each user needs to find out where it is located.

If I may - my suggestion to you would be that for each platform, upon pipx installation, you and your team agree upon setting PIPX_HOME to the same directory. My example for Windows is %UserProfile%\pipx\. This way, you can know where the installation is easier and a script can be written to fix this.

@sigma67
Copy link
Author

sigma67 commented Feb 28, 2025

As with many things, one can work around this in many ways. But I think it's reasonable to have a way to remove the temporary state left on the system by a tool, with that tool.

Example from apt:

sudo apt-get clean

@dukecat0 dukecat0 added the enhancement New feature or request label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants