pythonpipxargs

Is there a way to uninstall multiple packages with pip?


I am attempting to remove all of the installed "pyobjc-framework"-prefixed packages. I have tried the following:

% pip freeze | grep pyobjc-framework | xargs pip uninstall

but this barfs because each pip uninstall requires confirmation (perhaps a way to bypass this would be a solution).

Please help before I have to break down and uninstall each of these manually! Nobody wants that.


Solution

  • Your command should actually work if you add the -y | --yes flag to pip :-)

    -y, --yes Don't ask for confirmation of uninstall deletions.

    Possibly:

    % pip freeze | grep pyobjc-framework | xargs pip uninstall -y