V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
GradyYoung
V2EX  ›  Python

求解, PyInstaller 为什么在 GithubAction 上打包后体积比在本地大 5 倍(Mac arm 端)

  •  
  •   GradyYoung · 4 小时 15 分钟前 · 351 次点击

    仓库地址: https://github.com/gradyyoung/lang-tool

    就是一个简单的 demo 项目,我在我自己的 Mac M1 上面打包的.app 大小 100M ,但是在 Github Action 打包出来就有 500M ,差距太大

    环境信息:UV 虚拟环境 + Pyside6 + Python3.12.9

    求大佬帮忙看看🙏

    5 条回复    2026-02-11 17:52:40 +08:00
    ruanimal
        1
    ruanimal  
       4 小时 11 分钟前
    把打出来的包,打开分析对比下文件,不就有答案了吗
    JasonEWNL
        2
    JasonEWNL  
       3 小时 49 分钟前
    看着仓库本身有 main.spec 打包配置,但是 GitHub 的 build.yaml 配置里是直接 main.py 加行内参数打包。如果本地是走 main.spec 则确实会跟线上结果有差异,修改 build.yaml 也走 main.spec 应该就会一致。
    GradyYoung
        3
    GradyYoung  
    OP
       3 小时 42 分钟前
    @JasonEWNL 感谢回复!本地其实也是命令,那个 main.spec 是自动生成的,没有修改过。
    GradyYoung
        4
    GradyYoung  
    OP
       3 小时 40 分钟前
    @ruanimal 感谢回复!目前看到的问题是,本地打包的.app 里面基本上都是软连接,相当于同一个依赖或者资源只保留了一份;但是不知道 action 打包出来的为什么不是软连接,同一个文件在.app 中存在很多份。看 pyinstaller 的官方文档也没有提到软连接相关的
    Latin
        5
    Latin  
       53 分钟前
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2253 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 10:46 · PVG 18:46 · LAX 02:46 · JFK 05:46
    ♥ Do have faith in what you're doing.