2013-08-21 21 views
1

从这里搜索是我的setup.py现在。当我建立使用-A模式(化名),我的应用程序,然后尝试运行它,我得到这个错误:与tkinter和openpyxl和多个文件使用py2app?

enter image description here

在控制台我发现这个错误:

13年8月21日10 :09:46.203 PM com.apple.launchd.peruser.501 [249]:([0x0-0x150d50c] .org.py.pythonmac.unspecified.notebook_tracker [24469])退出代码:255

我的setup.py代码:

""" 
This is a setup.py script generated by py2applet 

Usage: 
    python setup.py py2app 
""" 

from setuptools import setup 
APP = ['notebook_tracker.app'] 
DATA_FILES = ['notebook_tracker.pyw'] 
OPTIONS = {'argv_emulation': True, 
      'packages': ['openpyxl','Tkinter']} 

setup(
    app=APP, 
    data_files=DATA_FILES, 
    options={'py2app': OPTIONS}, 
    setup_requires=['py2app'], 
    py_modules=['DialogTemplate','reports','customer','schedule','admin','log_data','payment'] 
) 

回答

1

我找到了解决我自己问题的方案。 openpyxl是一个包含在.egg文件中的库。 py2app和py2exe不能很好地与.egg文件配合使用。一旦我解压缩.egg文件并将其放入我的项目中,一切都很好。另外我的setup.py文件不需要太复杂,下面是可用的setup.py。另外,我停止在别名模式下构建它,它工作得很好。

""" 
Script for building the example. 

Usage: 
    python setup.py py2app 
""" 

from setuptools import setup 

setup(
    app=['notebook_tracker.pyw'], 
    setup_requires=["py2app"], 
)