2016-05-23 5 views
0

GUIの設計にQtDesignerを使用し、Pythonコードを生成するためにpyuic5を使用しました。 cxfreezeまたはpy2exeでフリーズした後、pyuic5が生成されたsetupUI関数でアプリケーションがクラッシュします。コードからアプリを実行するとき、それは想定どおりに動作します。私はdependencywalkerを使用した場合Cx_Freeze/py2exeの後のアクセス違反エラーQt5.5.1 App

#Add a QWidget to QTabWidget 
self.ModuleListingWidget.addTab(self.MarketingTab, "") 

試みる:私は(アナコンダ分布内)のpython 3.4を使用するとQt 5.5.1

(メインUIのsetupUI方法である)brokesをAPPコードの最初の部分

00:00:00.000: Started "dist\MAIN.EXE" (process 0x2938) at address 0x000C0000. Cannot hook module. 
00:00:00.000: Loaded "c:\windows\system32\NTDLL.DLL" at address 0x772C0000. Cannot hook module. 
00:00:00.047: Loaded "c:\windows\syswow64\KERNEL32.DLL" at address 0x76CA0000. Cannot hook module. 
00:00:00.047: Loaded "c:\windows\syswow64\KERNELBASE.DLL" at address 0x74BF0000. Cannot hook module. 
... 
00:00:00.125: First chance exception 0xC0000005 (Access Violation) occurred at address 0x721E5B10. 
00:00:00.125: Second chance exception 0xC0000005 (Access Violation) occurred at address 0x721E5B10. 

py2exeとcxfreezeの両方が、0xc0000005で(アクセス違反)同じエラーを与える:。結果をプロファイルするためには、それがエラーをログに記録し、次のexeファイル

この問題を解決するにはどうすればよいですか、それとも問題自体についてもっと理解できますか?ここで

はcxfreezeの設定です:

import sys 
from cx_Freeze import setup, Executable 

base = "Win32GUI" 
path_platforms = (".\platforms\qwindows.dll", "platforms\qwindows.dll") 
build_options = {"packages": ['atexit'], "include_files" : [ path_platforms ]} 

setup(
    name = "myapp", 
    version = "0.1", 
    description = "Sample cx_Freeze script", 
    options = {"build_exe" : build_options}, 
    executables = [Executable("main.py", base = base)] 
    ) 

とpy2Exeの設定:

from distutils.core import setup 
import py2exe 
import sys 
sys.argv.append('py2exe') 
import glob 
import src.MyProj 
setup(console=['main.py'], options = {"py2exe": {"typelibs": 
          # typelib for WMI 
          [('{565783C6-CB41-11D1-8B02-00600806D9B6}', 0, 1, 2)], 
          # create a compressed zip archive 
          "compressed": True, 
          'bundle_files': 1, 
          "optimize": 2, 

          "includes":['sip', "PyQt5", 'PyQt5.QtCore', 'PyQt5.QtWidgets', 'PyQt5.QtGui', 'PyQt5.QtSql']}}, 

    # The lib directory contains everything except the executables and the python dll. 
    # Can include a subdirectory name. 
    zipfile = "./shared.zip", 
     data_files=[ 
      ('Images', glob.glob('Images/*.*')), 
      ('sqldrivers', ('C:/Users/user/src/dist/plugins/qsqlmysql.dll',)), 

       ('/c/Python34/Lib/site-packages/PyQt5', ['C:/Python34/Lib/site-packages/PyQt5/Qt5Core.dll'])]) 

答えて

0

私が見つけて、そのためのソリューション、おそらく依存関係エラーができませんでした。代わりに私はpyinstallerを使用し、それは魅力のように動作します。

関連する問題