“AttributeError:'NoneType'对象没有属性写入”在windows cx\u freez上

2024-04-25 08:51:21 发布

您现在位置:Python中文网/ 问答频道 /正文

我能够在mac OS上创建一个独立的python dash应用程序,它在cx\ U Freeze上运行得非常好,但是当我在widows上重复这个过程时,它在运行时给了我一个错误:“AttributeError:'NoneType'object has no attribute write”,有没有解决这个问题的方法或者冻结应用程序的其他方法?我已经尝试了py2exe和PyInstaller没有运气,任何帮助将不胜感激,提前感谢。你知道吗

下面是在mac上运行的程序的输出图像,以及同一个程序在windows上出现错误的图像。你知道吗

windows error imagemac working program 我用python命令设置.py内置命令和终端 下面附上的是用python编写的安装文件,程序太大,无法在这里发布,但如果需要它的任何部分,我可以提供

from cx_Freeze import setup, Executable import sys buildOptions = dict( packages=["dash_core_components", "dash_html_components", "dash.dependencies", "dash", "dash_table", "flask", "numpy", "pandas", "plotly.figure_factory", "plotly.express", "jinja2", "sys", "_datetime", "io", "plotly.graph_objects", "xlrd", "plotly"], excludes=[], include_files=["Test.xlsx/"] ) base = 'Win32GUI' if sys.platform == 'win32' else None executables = Executable(script='FISE MGMT App.py', base=base, icon='icon.ico' ) setup(name='hadi', version='1.0', description='my app', options=dict(build_exe=buildOptions), executables=[executables])

编辑:所以我发现这个问题是因为我的基本设置为Win32GUI,而不是没有使用windows时,虽然这是工作,我想一种方式,命令不打开启动有没有办法做到这一点,而不得到'写'属性错误?你知道吗


Tags: 方法图像命令程序应用程序basewindowsmac

热门问题