简体   繁体   English

py2app产生包含我系统上所有库的捆绑软件

[英]py2app produces bundles that include all the libraries on my system

Even for a simple print "hello world" python script, it produces a bundle of 72,5mb in size. 即使对于简单的打印“ hello world” python脚本,它也会产生72.5mb的捆绑包。 Looking inside the script reveals that it seems to include all the Python and associated libraries installed on my system. 查看脚本内部,发现它似乎包括系统上安装的所有Python和关联库。 I am using a no thrills setup file to generate a bundle. 我正在使用一个不刺激的安装文件来生成捆绑包。

from setuptools import setup

APP = ['test.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True}

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
)

Yes, disk space is cheap, but A 72,5mb executable for a hello world one-liner is totally unacceptable. 是的,磁盘空间很便宜,但是对于一个世界您好,一个72.5mb的可执行文件是完全不能接受的。 Is there any way to fix this behaviour, considering according to the documentation it should include only needed libraries? 考虑到根据文档应仅包括所需的库,有什么方法可以解决此问题?

Ok found the solution. 确定找到了解决方案。 The problem was caused by the fact I was using Python that came with Mac OSX. 问题是由我使用Mac OSX附带的Python引起的。

I have reinstalled Python from Brew to a separate location and now py2app produces reasonably sized executables. 我已经将Python从Brew重新安装到单独的位置,现在py2app会生成合理大小的可执行文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM