成功解决cx_Freeze打包的时候出现importError:can not import name idnadata

简介: 成功解决cx_Freeze打包的时候出现importError:can not import name idnadata

解决问题



cx_Freeze打包的时候出现importError:can not import name idnadata



解决方法


exe = Executable(script="WeChat.py", icon="Jasonniu.ico", base="Win32GUI")

buildOptions = dict(excludes = ["tkinter"], includes =["idna.idnadata"], optimize=1)

setup(name = "instagram",version = "1.0", description = "test", executables = [exe], options = dict(build_exe = buildOptions))



解决问题



image.png


AttributeError: 'NoneType' object has no attribute 'write'



解决方法


exe = Executable(script="WeChat.py", icon="Jasonniu.ico", base="Win32GUI")

buildOptions = dict(excludes = ["tkinter"], includes =["idna.idnadata"], optimize=1)

setup(name = "instagram",version = "1.0", description = "test", executables = [exe], options = dict(build_exe = buildOptions))


 

相关文章
|
7月前
|
TensorFlow 算法框架/工具 Python
python报错:ImportError: cannot import name ‘_tf_stack‘ from ‘tenso
ImportError: cannot import name ‘_tf_stack’ from ‘tensorflow.python’本来keras和tensorflow用得好好的,忽然今天报错导入包得时候直接报错。在网上找了很多方法,但是用处都不大,尝试了很多遍都不行。于是尝试将tensorflow和keras卸载重装。(需要彻底卸载,pip命令后还需要删除文件夹中得几个文件夹,也就是...
69 1
成功解决ImportError: cannot import name ‘InvalidSchemeCombination‘ from ‘pip._internal.exceptions‘
成功解决ImportError: cannot import name ‘InvalidSchemeCombination‘ from ‘pip._internal.exceptions‘
|
9月前
|
计算机视觉 Python
成功解决Python导入opencv报错“DLL load failed while importing cv2: 找不到指定的模”
成功解决Python导入opencv报错“DLL load failed while importing cv2: 找不到指定的模”
186 0
|
5月前
|
编译器 Python
Python 完美解决 Import "模块" could not be resolved ...
Python 完美解决 Import "模块" could not be resolved ...
51 0
ImportError: cannot import name ‘options‘ from ‘pyecharts‘
ImportError: cannot import name ‘options‘ from ‘pyecharts‘
485 0
ImportError: cannot import name ‘options‘ from ‘pyecharts‘
|
9月前
|
编译器 Python
Python 完美解决 Import “模块“ could not be resolved ...
Python 完美解决 Import “模块“ could not be resolved ...
184 0
|
12月前
|
PyTorch 算法框架/工具 Python
代码import torch 报错 ImportError: numpy.core.multiarray failed to import
代码import torch 报错 ImportError: numpy.core.multiarray failed to import
249 0
|
12月前
|
机器学习/深度学习 人工智能 数据挖掘
|
机器学习/深度学习 PyTorch 算法框架/工具