Delete all libraries installed on pip with a single command

Introduction

Sometimes I want to delete all pip libraries,

pip freeze > u.txt
pip uninstall -r u.txt -y

Since it is troublesome to do, I thought about how to delete the library of one line pip.

command

pip uninstall -r <(pip freeze) -y

Description

[Concept of process substitution](https://shellscript.sunone.me/input_output.html#%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E7%BD% I referred to AE% E6% 8F% 9B-) (1). Based on this idea, we were able to shorten the temporary file u.txt to one line by rewriting it as `<(pip freeze)`.

at the end

It's fun to be able to put simple commands that you use each time on one line, which will improve your work efficiency and give you some tips on how to use the commands.

References

(1) [UNIX & Linux Command / Shell Script Reference](https://shellscript.sunone.me/input_output.html#%E3%83%97%E3%83%AD%E3%82%BB%E3%82] % B9% E7% BD% AE% E6% 8F% 9B-)

Recommended Posts

Delete all libraries installed on pip with a single command
Build a local server with a single command [Mac]
Compile and run Rust with a single command
Import libraries that cannot be pip installed with PyCharm
Restore what was installed with pip3 on another PC
Create a list in Python with all followers on twitter
A memo for when pip3 is installed with python2.7 for some reason
Command installation destination with pip, easy_install
Uninstall everything you installed with pip
Upload data to s3 of aws with a command and update it, and delete the used data (on the way)
Use shutil to delete all folders with a small number of files
Create a command to delete all temporary files generated in a specific folder
Install the python module with pip on a server without root privileges
Generate all files with a specific extension
Delete all unnecessary Gmail emails with API
A memo with Python2.7 and Python3 on CentOS
Map rent information on a map with python
Throw a request with a certificate on httpie
scipy stumbles with pip install on python 2.7.8
I installed Kivy on a Mac environment
A workaround when installing pyAudio with pip.
A note on enabling PostgreSQL with Django
Zip-compress any file with the [shell] command to create a file and delete the original file.
Build a TensorFlow development environment on Amazon EC2 with command copy and paste