Python pyqt文件到py2exe运行时生成的exe文件错误:此应用程序已请求运行时以异常方式终止它
我在python文件中使用了cv2包。在通过py2exe将文件转换为exe文件之前,它可以工作。但是当转换exe文件时,我得到了运行时错误!此应用程序已请求运行时以异常方式终止它。这是我的档案。 test1.py test2.pyPython pyqt文件到py2exe运行时生成的exe文件错误:此应用程序已请求运行时以异常方式终止它,python,opencv,pyqt,py2exe,Python,Opencv,Pyqt,Py2exe,我在python文件中使用了cv2包。在通过py2exe将文件转换为exe文件之前,它可以工作。但是当转换exe文件时,我得到了运行时错误!此应用程序已请求运行时以异常方式终止它。这是我的档案。 test1.py test2.py import numpy as np import cv2 from cv2 import cvtColor class opencv_test: def change(self,filename): print filename
import numpy as np
import cv2
from cv2 import cvtColor
class opencv_test:
def change(self,filename):
print filename
img = cv2.imread(filename)
img = cvtColor(img, cv2.COLOR_BGR2RGB)
cv2.imwrite("C:\\pythontest\\certphoto\\output\\what.jpg",img)
转换为exe文件setup.py
from distutils.core import setup
import py2exe
import sys
sys.argv.append('py2exe')
py2exe_options = {
"includes": ["sip","numpy","cv2"],
"dll_excludes": ["MSVCP90.dll",],
"compressed": 1,
"optimize": 2,
"ascii": 0,
"bundle_files": 1,
}
setup(
name = 'PyQt Demo',
version = '1.0',
windows = [r'C:\pythontest\testphoto\test1.py'],
zipfile = None,
options = {'py2exe': py2exe_options}
)
错误消息:
from distutils.core import setup
import py2exe
import sys
sys.argv.append('py2exe')
py2exe_options = {
"includes": ["sip","numpy","cv2"],
"dll_excludes": ["MSVCP90.dll",],
"compressed": 1,
"optimize": 2,
"ascii": 0,
"bundle_files": 1,
}
setup(
name = 'PyQt Demo',
version = '1.0',
windows = [r'C:\pythontest\testphoto\test1.py'],
zipfile = None,
options = {'py2exe': py2exe_options}
)