Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to uninstall multiple packages with pip?

Tags:

python

pip

xargs

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.

like image 361
wh1tney Avatar asked Feb 23 '12 02:02

wh1tney


People also ask

What is the easiest way to remove all packages installed by pip?

You can use pip uninstall -y -r <(pip freeze) to do everything in one go.

Can you uninstall packages with pip?

Packages can be uninstalled from a virtual environment using pip or pipenv.


1 Answers

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

like image 174
jdi Avatar answered Sep 20 '22 20:09

jdi