Files
EasySpider/ExecuteStage/generateExecutable_Macos.sh
Li Yanxiao da90005bba feat: 修改 full 版本打包 onnx 和 ocr 文件的路径为解释器给出的路径
修改 macOS full 版本打包时添加的文件为基于当前解释器安装的 onnxruntime 和 ddddocr 软件包得到的地址,而不是写死的绝对地址。
2025-07-01 22:41:23 +08:00

22 lines
1.5 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 先打包一个不带ddddocr和pandas的版本然后再打包一个带的版本不带ddddocr和pandas的版本运行速度会快很多
rm -r build
rm -r dist
pyinstaller -F --icon=favicon.ico easyspider_executestage.py --exclude-module ddddocr --exclude-module onnxruntime --exclude-module onnx --exclude-module onnxruntime_pybind11_state.so --exclude-module pillow --exclude-module pandas --exclude-module numpy --exclude-module scipy --exclude-module sklearn
rm ../.temp_to_pub/EasySpider_MacOS/easyspider_executestage
cp dist/easyspider_executestage ../.temp_to_pub/EasySpider_MacOS/easyspider_executestage
# mv dist/easyspider_executestage ../ElectronJS/easyspider_executestage
echo "With ddddocr and pandas"
# # 打包带ddddocr和pandas的版本
rm -r build
rm -r dist
# Get the site-packages path for ddddocr and onnxruntime
# 如果当前终端激活了 conda 环境,下方脚本应当可以正确的从 conda 环境安装的包中获得数据文件位置
ddddocr_path=$(python3 -c "import ddddocr; print(ddddocr.__path__[0])")
onnxruntime_path=$(python3 -c "import onnxruntime; print(onnxruntime.__path__[0])")
pyinstaller -F --icon=favicon.ico --add-data "$onnxruntime_path/capi/onnxruntime_pybind11_state.so:onnxruntime/capi" --add-data "$ddddocr_path/common_old.onnx:ddddocr" easyspider_executestage.py
rm ../.temp_to_pub/EasySpider_MacOS/easyspider_executestage_full
cp dist/easyspider_executestage ../.temp_to_pub/EasySpider_MacOS/easyspider_executestage_full