好的,我正在尝试使用py2app为我的项目生成一个分发版。我仍然不确定我是否已经掌握了它。所以我的setup.py看起来像这样:
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
import setuptools
PACKAGES = ['sqlalchemy.dialects.sqlite']
MODULES = ['sqlite3']
APP = ['tvb/interfaces/web/run.py']
OPTIONS = {'argv_emulation': True,
'packages': PACKAGES ,
'includes' : MODULES }
DATA_FILES = []
setup(
app=APP,
data_files=DATA_FILES,
packages = setuptools.find_packages(),
include_package_data=True,
options={'py2app': OPTIONS},
setup_requires=['py2app', "pyopengl", "cherrypy", "sqlalchemy", "simplejson",
"formencode", "genshi", "quantities","numpy", "scipy",
"numexpr", "nibabel", "cfflib", "mdp", "apscheduler",
"scikits.learn"]
)
所以我的第一个问题是:我应该在模块中包含哪些py2app? py2app是否知道在setup_requires中扫描并包含它们,或者我是否需要在MODULES中为它们添加一些条目?
另一个问题是我在尝试运行我的应用时遇到了sqlalchemy.exc.ArgumentError: Could not determine dialect for 'sqlite'
。经过大量的谷歌搜索我只看到py2exe你需要包含sqlalchemy.dialects.sqlite
作为一个包,但它似乎不适合我。我在这里错过了什么吗?
最后一个是我在malformed object (load command 3 cmdsize not a multiple of 8)
之前得到:python setup.py py2app
。这是正常的吗?
此致 波格丹
答案 0 :(得分:3)
'includes' : ['sqlalchemy.dialects.sqlite']
而不是包,而这似乎已经成功了。