How to bulk install or uninstall with pip of Python
In this article, introduce how to bulk install with pip of Python.
Let’s get straight to the point!
How to bulk install with pip
- Output text file of package list
- bulk install packages
Output text file of package list
pip freeze > requirements.txt
if execute the above command, out put package list on requirements.txt.
requirements.txt is any name, but generally use “requirements.txt”.
bulk install packages
pip install -r requirements.txt
if you out put package list file, execute the above command and install packages of list.
To add “-r” is bulk install option.
How to bulk uninstall with pip
While I’m at it, I introduce how to bulk uninstall with pip.
If you want to bulk uninstall, execute the following command.
pip freeze > uninstall.txt
pip uninstall -r uninstall.txt
pip uninstall -y -r uninstall.txt
uninstall.txt is any name, but generally use “uninstall.txt”.
And then, “-y” means “yes”.
This option omit confirmation of “yes” or “no” when delete package.
