I want to remove some older versions and I'm wondering do I have to remove all of the packages installed via pip first, then do a pyenv uninstall [version]?
Your answer pip install --user somepackage installs to $HOME/. local, and uninstalling it does work using pip uninstall somepackage. This is true whether or not somepackage is also installed system-wide at the same time. If the package is installed at both places, only the local one will be uninstalled.
@patelshahrukh uninstalling python DOES NOT remove pip packages. please AVOID doing that, since it both most likely WON'T WORK the way you think it will, and, depending on how you install python again, can leave your machine in an unstable state that's more work to fix.
You can use pip uninstall -y -r <(pip freeze) to do everything in one go.
In essence pyenv uninstall
removes the entire directory with a python version. So yes, I'm sure it removes installed packages as they are in $PREFIX/lib/pythonX.Y/site-packages
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With