cx_freeze,导入错误:DLL加载失败(tkinter) [英] cx_freeze, import error: DLL load failed (tkinter)
本文介绍了cx_freeze,导入错误:DLL加载失败(tkinter)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
该错误在我使用cx_freeze构建后得到了认可。而我的setup.py代码是
that error apprerd after I builded with cx_freeze. and my setup.py code is
import sys
from cx_Freeze import setup, Executable
import numpy.core._methods
import numpy.lib.format
import os
build_exe_options = dict(
compressed = True,
includes = ["os","operator", "requests", "konlpy", "bs4", "copy", "jpype","numpy","idna","lxml","datetime","pygame","os","PIL","wordcloud","matplotlib","tkinter"],
include_files = []
)
os.environ['TCL_LIBRARY'] = r'C:\Users\airne\Anaconda3\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\airne\Anaconda3\tcl\tk8.6'
setup(
name = "Search Key Word",
version = "2.0",
author = "airnew",
description = "검색엔진 키워드 분석",
options = {"build_exe": {"packages":["os","operator","requests","konlpy","bs4","copy","jpype","numpy","idna","lxml","datetime","pygame","os","PIL","wordcloud","matplotlib","tkinter"]}},
executables = [Executable("SearchKeyWord.py",base = "Win32GUI")],
)
推荐答案
我前段时间也遇到过类似的问题。这对我有用:
I've had similar problem some time ago. That worked for me:
import sys
from cx_Freeze import setup, Executable
import os.path
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
options = {
'build_exe': {
'include_files':[
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
],
},
}
这篇关于cx_freeze,导入错误:DLL加载失败(tkinter)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文