简体   繁体   English

windows cx_freeze 上的“AttributeError: 'NoneType' object 没有属性写入”

[英]“AttributeError: ‘NoneType’ object has no attribute write” on windows cx_freeze

i was able to create a standalone python dash app on mac OS and it runs perfectly with cx_Freeze however when i repeat the process on widows it gives me an error during runtime: “AttributeError: 'NoneType' object has no attribute write”, is there any way to solve this issue or another way of freezing the application?我能够在 Mac OS 上创建一个独立的 python dash 应用程序,它可以与 cx_Freeze 完美运行,但是当我在寡妇上重复该过程时,它在运行时给我一个错误:“AttributeError:'NoneType' object 没有属性写入”,是吗有什么办法可以解决这个问题或冻结应用程序的其他方式? i have tried py2exe and PyInstaller with no luck, any help would be appreciated, thanks in advance.我已经尝试了 py2exe 和 PyInstaller 没有运气,任何帮助将不胜感激,在此先感谢。

below are the images of the program running on mac with the output:下面是使用 output 在 mac 上运行的程序的图像:

mac 工作程序

and the same program with an error on windows.同样的程序在 windows 上有错误。

windows错误图片

i used the command python setup.py build in CMD and Terminal below attached is the setup file written in python, the program is too large to post here but if any part of it needed i can provide我使用命令 python setup.py build in CMD 和下面的终端是用 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])

EDIT: so i figured out that the issue was because my base was set to Win32GUI instead of none when using windows, although that works, I would like a way where the CMD does not open on startup is there a way to do that without getting that 'write' attribute error?编辑:所以我发现问题是因为在使用 windows 时我的基础设置为 Win32GUI 而不是无,虽然这可行,但我想要一种 CMD 在启动时不打开的方法有没有办法做到这一点那个'写'属性错误?

I faced the same issue couple of days ago and finally fixed.几天前我遇到了同样的问题,终于解决了。 I have posted the answer here: https://stackoverflow.com/a/63964910/14300057我在这里发布了答案: https://stackoverflow.com/a/63964910/14300057

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 cx_Freeze + curses:“ NoneType”对象没有属性“ fileno” - cx_Freeze + curses: 'NoneType' object has no attribute 'fileno' Python 3.3 cx_freeze奇怪的错误:“ NoneType”对象没有属性“ path” - Python 3.3 cx_freeze weird error: 'NoneType' object has no attribute 'path' cx_Freeze属性错误:“列表”对象没有属性“项目” - cx_Freeze Attribute error: 'list' object has no attribute 'items' cx_Freeze“列表”对象没有属性“项目” - cx_Freeze 'list' object has no attribute 'items' 使用 cx_Freeze 将 python 文件转换为可执行文件,然后得到错误 AttributeError: 'list' object has no attribute 'main_script' - Convert a python file into an executable with cx_Freeze then get error AttributeError: 'list' object has no attribute 'main_script' cx_freeze AttributeError:模块'dis'没有属性'_unpack_opargs' - cx_freeze AttributeError: module 'dis' has no attribute '_unpack_opargs' Python,AttributeError:cx_Freeze 构建后,模块“google.cloud.bigquery”没有属性“Client” - Python, AttributeError: module 'google.cloud.bigquery' has no attribute 'Client' after cx_Freeze build cx 冻结:AttributeError:'list' 对象没有属性 'items' - cx freeze : AttributeError: 'list' object has no attribute 'items' 使自动更新zip cx_freeze和esky'Freezer'对象没有属性'createLibraryZip'时出错 - Error making auto-update zip cx_freeze and esky 'Freezer' object has no attribute 'createLibraryZip' AttributeError:使用CX_FREEZE构建Python 3.6可执行文件时,模块'dis'没有属性'_unpack_opargs' - AttributeError: module 'dis' has no attribute '_unpack_opargs' While Building Python 3.6 executable using CX_FREEZE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM