From 625e456e6b218ec043e8079d1324f3e3c86451c8 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Mon, 14 Aug 2023 16:46:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddeepin23=E7=BC=BA=E5=A4=B1pil?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- getxmlimg.py | 10 ++++++++-- new-deb-build/DEBIAN/postinst | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/getxmlimg.py b/getxmlimg.py index af59a70..2bda884 100755 --- a/getxmlimg.py +++ b/getxmlimg.py @@ -1,5 +1,11 @@ -import PIL.Image as Image -import PIL.ImageDraw as ImageDraw +import os +try: + import PIL.Image as Image + import PIL.ImageDraw as ImageDraw +except: + os.system("python3 -m pip install --upgrade pillow --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple") + import PIL.Image as Image + import PIL.ImageDraw as ImageDraw import zipfile import subprocess import re diff --git a/new-deb-build/DEBIAN/postinst b/new-deb-build/DEBIAN/postinst index 80eb3b1..f65225b 100755 --- a/new-deb-build/DEBIAN/postinst +++ b/new-deb-build/DEBIAN/postinst @@ -1,10 +1,10 @@ #!/bin/bash # 使用 pip 安装所需库 echo 安装组件 -python3 -m pip install --upgrade ttkthemes --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true -python3 -m pip install --upgrade pyautogui --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true -python3 -m pip install --upgrade keyboard --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true -python3 -m pip install --upgrade pillow --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true +python3 -m pip install --upgrade ttkthemes --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true +python3 -m pip install --upgrade pyautogui --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true +python3 -m pip install --upgrade keyboard --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true +python3 -m pip install --upgrade pillow --break-system-packages --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true echo 执行完成 # 建立软链接 ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner /usr/bin/uengine-runner