"pip uninstall" stuck for long if no "-v" is given for some package
See original GitHub issueDescription
When uninstalling smashpy
, pip stuck for long in listing the file to delete (and keep). WIth -v
this stuck does not happen.
IMO, the function compress_for_output_listing
has some problem with this package:
Expected behavior
pip uninstall
is generally expected to respond more quickly without -v
than with it.
pip version
21.1.3
Python version
3.9.6
OS
Arch Linux
How to Reproduce
pip install smashpy
pip uninstall smashpy
- pip displays the uninstall information slowly
pip uninstall smashpy -v
- pip displays the uninstall information quickly
Output
$ pip uninstall smashpy
Found existing installation: smashpy 0.0.8
Uninstalling smashpy-0.0.8:
Would remove:
/tmp/venv/lib/python3.9/site-packages/*
Would not remove (might be manually added):
/tmp/venv/lib/python3.9/site-packages/Keras-2.4.3.dist-info/INSTALLER
/tmp/venv/lib/python3.9/site-packages/Keras-2.4.3.dist-info/LICENSE
/tmp/venv/lib/python3.9/site-packages/Keras-2.4.3.dist-info/METADATA
/tmp/venv/lib/python3.9/site-packages/Keras-2.4.3.dist-info/RECORD
(thousands of lines omitted)
$ pip uninstall smashpy -v
Found existing installation: smashpy 0.0.8
Uninstalling smashpy-0.0.8:
Would remove:
/tmp/venv/lib/python3.9/site-packages/__init__.py
/tmp/venv/lib/python3.9/site-packages/__pycache__/__init__.cpython-39.pyc
/tmp/venv/lib/python3.9/site-packages/__pycache__/_version.cpython-39.pyc
/tmp/venv/lib/python3.9/site-packages/__pycache__/pySMaSH.cpython-39.pyc
/tmp/venv/lib/python3.9/site-packages/__pycache__/smashpy.cpython-39.pyc
/tmp/venv/lib/python3.9/site-packages/_version.py
/tmp/venv/lib/python3.9/site-packages/pySMaSH.py
/tmp/venv/lib/python3.9/site-packages/smashpy-0.0.8.dist-info/INSTALLER
/tmp/venv/lib/python3.9/site-packages/smashpy-0.0.8.dist-info/LICENSE
/tmp/venv/lib/python3.9/site-packages/smashpy-0.0.8.dist-info/METADATA
/tmp/venv/lib/python3.9/site-packages/smashpy-0.0.8.dist-info/RECORD
/tmp/venv/lib/python3.9/site-packages/smashpy-0.0.8.dist-info/REQUESTED
/tmp/venv/lib/python3.9/site-packages/smashpy-0.0.8.dist-info/WHEEL
/tmp/venv/lib/python3.9/site-packages/smashpy-0.0.8.dist-info/top_level.txt
/tmp/venv/lib/python3.9/site-packages/smashpy.py
Will actually move:
/tmp/venv/lib/python3.9/site-packages/__init__.py
/tmp/venv/lib/python3.9/site-packages/__pycache__/__init__.cpython-39.pyc
/tmp/venv/lib/python3.9/site-packages/__pycache__/_version.cpython-39.pyc
/tmp/venv/lib/python3.9/site-packages/__pycache__/pySMaSH.cpython-39.pyc
/tmp/venv/lib/python3.9/site-packages/__pycache__/smashpy.cpython-39.pyc
/tmp/venv/lib/python3.9/site-packages/_version.py
/tmp/venv/lib/python3.9/site-packages/pySMaSH.py
/tmp/venv/lib/python3.9/site-packages/smashpy-0.0.8.dist-info/
/tmp/venv/lib/python3.9/site-packages/smashpy.py
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
How to fix pip hanging on uninstalling sqlalchjemy
Looks like pip uninstall prompts you with "Do you want to continue (Y/N)?", but that is not visible in cygwin or git bash...
Read more >pip install --upgrade stalls at the "uninstalling" phase #6169
Running pip install --upgrade for any package that needs upgrading will cause pip to stall at the "Uninstalling" stage. Expected behavior.
Read more >How to Uninstall Python Packages - ActiveState
Open a command window by entering 'cmd' in the Search Box of the Task bar; Press Ctrl+Shift+Enter to gain Administration (Admin) privileges; pip...
Read more >pip Documentation
Successfully uninstalled SomePackage. Running setup.py install for SomePackage. Successfully installed SomePackage. Uninstall a package:.
Read more >Uninstalling Anaconda Distribution
Full Uninstall¶ · In Windows, open Anaconda Prompt. In Mac or Linux, open your terminal application. · Install the anaconda-clean package: conda install...
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 FreeTop 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
Top GitHub Comments
This looks like a bug in the packaging of smashpy - it’s installing files (including an
__init__.py
entry) direct intosite-packages
, and that’s somehow making pip think it needs to remove all of the site-packages directory!Pip should probably protect better against badly packaged projects like this, but smashpy needs fixing as well…
Got it. Thanks for your detailed explanation! ❤️