From 49208c95334834e5a8405e8d9b5ec20dc35a2490 Mon Sep 17 00:00:00 2001 From: Chiya <47343409+UraraChiya@users.noreply.github.com> Date: Wed, 26 Oct 2022 00:19:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E5=90=8E=E5=88=A0=E9=99=A4pip?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E9=98=B2=E6=AD=A2=E5=88=A0=E9=99=A4=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E5=90=8E=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=E7=BB=AD=E7=9A=84=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mother.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mother.py b/mother.py index 4b114f4..19a92c5 100644 --- a/mother.py +++ b/mother.py @@ -6,11 +6,13 @@ for line in process.stdout.decode().strip().split('\n')[2:]: name, version = line.strip().split() - subprocess.run(f'pip uninstall {name} -y') + if not 'pip' == name: + subprocess.run(f'pip uninstall {name} -y') process = subprocess.run('pip cache dir', shell=True, capture_output=True) cache_dir = process.stdout.decode().strip() shutil.rmtree(cache_dir) +subprocess.run(f'pip uninstall pip -y') print("Done.") os.remove(__file__)