py2app setup.py usage question

﹥>﹥吖頭↗ 提交于 2019-12-05 03:01:44

问题


Ok so I'm trying to use py2app to generate a distribution for my project. I'm still not sure I get the hang of it tho. So my setup.py looks like this:

"""
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"]
)

So my first question would be: What should I include in my MODULES for py2app here? Does py2app know to scan for the things in setup_requires and include them or do I need to add some entries for them in MODULES ?

Another problem is that I'm getting an: sqlalchemy.exc.ArgumentError: Could not determine dialect for 'sqlite' when trying to run my app. After lots of googling I only saw that for py2exe you need to include the sqlalchemy.dialects.sqlite as a package but it doesn't seem to work for me. Am I missing something here?

The last one is that I'm getting a: malformed object (load command 3 cmdsize not a multiple of 8) just before the python setup.py py2app. Is this normal?

Regards, Bogdan


回答1:


Well seems I got the whole thing wrong.

'includes' : ['sqlalchemy.dialects.sqlite']

Instead of packages, and that seems to have done the trick.



来源:https://stackoverflow.com/questions/7270554/py2app-setup-py-usage-question

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!