国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

當(dāng)使用cx_Freeze和tkinter時(shí),我得到:“ DLL加載失?。赫也坏街付ǖ哪K?!?(Python 3.5.3)

瀏覽:108日期:2022-08-07 10:50:06
如何解決當(dāng)使用cx_Freeze和tkinter時(shí),我得到:“ DLL加載失?。赫也坏街付ǖ哪K。” (Python 3.5.3)?

找到了解決方案!

我必須將tk86t.dll和tcl86t.dll文件從python目錄的DLLs文件夾復(fù)制到帶有嘗試編譯的main.py的build文件夾中。

這與

set TCL_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonpython35tcltcl8.6 set TK_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonpython35tcltk8.6

在我的compile.bat的頂部,以及'include_files': ['tcl86t.dll', 'tk86t.dll'] 在setup.py的build_exe_options中,似乎已經(jīng)解決了這個(gè)問題。

這是我當(dāng)前的setup.py:

from cx_Freeze import setup, Executable import sysbuild_exe_options = {'packages': ['files', 'tools'], 'include_files': ['tcl86t.dll', 'tk86t.dll']}base = None if sys.platform == 'win32': base = 'win32gui'setup(name='Name', version='1.0', description='Description', options={'build_exe': build_exe_options}, executables=[Executable('main.py', base=base)], package_dir={’’: ’’}, )

這是我的compile.bat(已更新以顯示所有步驟):

@echo offset TCL_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonpython36-32tcltcl8.6set TK_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonpython36-32tcltk8.6RD /S /Q 'C:UsersVergilTheHuragokDesktopPythonProjectCompiledbin'mkdir 'C:UsersVergilTheHuragokDesktopPythonProjectCompiledbin'xcopy /s 'C:UsersVergilTheHuragokAppDataLocalProgramsPythonpython36-32DLLstcl86t.dll' 'C:UsersVergilTheHuragokDesktopPythonProjectCompiledbintcl86t.dll'xcopy /s 'C:UsersVergilTheHuragokAppDataLocalProgramsPythonpython36-32DLLstk86t.dll' 'C:UsersVergilTheHuragokDesktopPythonProjectCompiledbintk86t.dll'cd 'C:UsersVergilTheHuragokDesktopPythonProject'cxfreeze main.py --target-dir 'C:UsersVergilTheHuragokDesktopPythonProjectCompiledbin' --target-name 'launch.exe'pause解決方法

當(dāng)使用cx_Freeze和Tkinter時(shí),出現(xiàn)以下消息:

File 'C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython35-32libtkinter__init__.py',line 35,in <module>import _tkinter # If this fails your Python may not be configured for TkImportError: DLL load failed: The specified module could not be found.

注意事項(xiàng):

我想使用Python 3+(當(dāng)前使用3.5.3,32位)。不管實(shí)際如何,都不在乎特定版本。我的項(xiàng)目有多個(gè)文件需要編譯。據(jù)我所知,這讓我留下了cx_Freeze或Nuitka。努伊特卡有自己的問題。我正在使用Windows 10家庭版64位

這是我當(dāng)前的setup.py:

from cx_Freeze import setup,Executable import sysbuild_exe_options = {'packages': ['files','tools']}base = None if sys.platform == 'win32':base = 'Win32GUI'setup(name='Name',version='1.0',description='Description',options={'build_exe': build_exe_options},executables=[Executable('main.py',base=base)],package_dir={’’: ’’},)

我已經(jīng)嘗試了來(lái)自互聯(lián)網(wǎng)各個(gè)角落的許多解決方案。包括但不僅限于:

多個(gè)版本的python(以及相應(yīng)的cx_Freeze / Tkinter版本)32位和64位版本用easygui替換Tkinter(顯然easygui需要Tkinter來(lái)工作)檢查PATH變量重新啟動(dòng)計(jì)算機(jī)(不知道我的期望)卸載其他版本的python并修復(fù)正確的版本

將以下內(nèi)容放入我的編譯bat文件(正確的路徑):

set TCL_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython35-32tcltcl8.6

set TK_LIBRARY=C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython35-32tcltk8.6

在我的setup.py中放置以下內(nèi)容:

options={'build_exe': {'includes': ['tkinter']}}

隨著:

include_files = [r'C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython35-32DLLstcl86t.dll', r'C:UsersVergilTheHuragokAppDataLocalProgramsPythonPython35-32DLLstk86t.dll']

(是的,這些以一種或另一種方式包含在setup()中)

感謝您的幫助,我們將不勝感激。是的,我已經(jīng)在該站點(diǎn)上查看了針對(duì)該問題的幾乎所有解決方案。希望有人可以幫助我找到另一種解決方案,因?yàn)槲业膯栴}似乎一直存在。

標(biāo)簽: Python 編程
主站蜘蛛池模板: 华阴市| 德清县| 浦县| 宽甸| 北票市| 和田县| 长沙县| 松阳县| 河源市| 玉门市| 布拖县| 红桥区| 黄浦区| 武邑县| 铜川市| 万源市| 儋州市| 鄂伦春自治旗| 南汇区| 贞丰县| 乌兰浩特市| 庆城县| 盘锦市| 达日县| 历史| 台东市| 新化县| 普宁市| 灵川县| 土默特左旗| 永定县| 西乡县| 行唐县| 云浮市| 新巴尔虎左旗| 绥江县| 通许县| 郯城县| 阿鲁科尔沁旗| 汾阳市| 天长市|