Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python py2app不包括PySide模块_Python_Pyside_Py2app - Fatal编程技术网

Python py2app不包括PySide模块

Python py2app不包括PySide模块,python,pyside,py2app,Python,Pyside,Py2app,简单的hello world QT python脚本。从命令行可以很好地工作。当我打包时,我得到: Traceback (most recent call last): File "/Users/jquick/bin/dist/gui.app/Contents/Resources/__boot__.py", line 340, in <module> _run('/Users/jquick/bin/gui.py') File "/Users/jquick/bin/di

简单的hello world QT python脚本。从命令行可以很好地工作。当我打包时,我得到:

Traceback (most recent call last):
  File "/Users/jquick/bin/dist/gui.app/Contents/Resources/__boot__.py", line 340, in <module>
    _run('/Users/jquick/bin/gui.py')
  File "/Users/jquick/bin/dist/gui.app/Contents/Resources/__boot__.py", line 336, in _run
    execfile(scriptpath, globals(), globals())
  File "/Users/jquick/bin/gui.py", line 3, in <module>
    from PySide.QtCore import *
ImportError: No module named PySide.QtCore
2012-06-02 00:23:04.823 gui[4835:707] gui Error
我尝试了使用--alias选项和不使用--alias选项创建。甚至试着把它们贴上包装标签。但我所做的一切似乎都没有包括他们

  • Python能找到PySide.QtCore吗?在命令行中键入:

    从PySide.QtCore导入*

  • 如果(1)有效,那么确保在命令行执行py2app时调用的Python版本与步骤(1)中使用的Python版本相同。有些操作系统(如Mac OS X)安装了较旧版本的Python,如果您的应用程序在命令行中调用它时工作正常,那么在尝试构建应用程序时,请确保您没有调用完全不同版本的Python

  • """
    This is a setup.py script generated by py2applet
    
    Usage:
        python setup.py py2app
    """
    
    from setuptools import setup
    
    APP = ['gui.py']
    DATA_FILES = []
    OPTIONS = {'argv_emulation': True, 'includes': ['PySide.QtCore', 'PySide.QtGui']}
    
    setup(
        app=APP,
        data_files=DATA_FILES,
        options={'py2app': OPTIONS},
        setup_requires=['py2app'],
    )