2

我在 Fedora 18 上使用 py2app 时遇到了问题:

running py2app
creating /run/media/vik2015/D0DD-6FB2/MacEdit/build/bdist.linux-x86_64/python2.7-semi_standalone/app
creating /run/media/vik2015/D0DD-6FB2/MacEdit/build/bdist.linux-x86_64/python2.7-semi_standalone/app/collect
creating /run/media/vik2015/D0DD-6FB2/MacEdit/build/bdist.linux-x86_64/python2.7-semi_standalone/app/temp
creating build/bdist.linux-x86_64/python2.7-semi_standalone/app/lib-dynload
creating build/bdist.linux-x86_64/python2.7-semi_standalone/app/Frameworks
*** using recipe: virtualenv ***
*** using recipe: email ***
*** filtering dependencies ***
351 total
342 filtered
0 orphaned
9 remaining
*** create binaries ***
*** byte compile python files ***
byte-compiling /usr/lib/python2.7/site-packages/pkg_resources.py to pkg_resources.pyc
*** creating application bundle: do_it ***
skipping byte-compilation of /run/media/vik2015/D0DD-6FB2/MacEdit/dist/do_it.app/Contents/Resources/site.py to site.pyc
copying do_it.py -> /run/media/vik2015/D0DD-6FB2/MacEdit/dist/do_it.app/Contents/Resources
creating /run/media/vik2015/D0DD-6FB2/MacEdit/dist/do_it.app/Contents/Resources/lib
creating /run/media/vik2015/D0DD-6FB2/MacEdit/dist/do_it.app/Contents/Resources/lib/python2.7
error: Operation not permitted

如果有帮助,这是我的setup.py

from setuptools import setup

APP = ['do_it.py']
OPTIONS = {'argv_emulation': True, 'includes': [],}

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

do_it.py

import os
os.system("python program.py")
4

1 回答 1

2

作为从 Python 构建的跨平台平台,请尝试PyInstaller

我们在 Windows 和 Linux 上成功地使用了它,但是我们有一个.spec用于 Windows 构建机器的文件和一个稍微不同的用于 Linux 构建机器的文件。在 Linux 和 Windows 上构建相同的工具的好处是我们可以为两者提供一组通用功能。

由于我们也在 Mac 上分发我们的应用程序,因此我们也在使用py2app,但在专用的 Mac Osx 构建机器上。

于 2014-09-19T08:20:52.177 回答