Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ImportError:没有名为_tkinter_finder的模块_Python_Tkinter_Pyinstaller - Fatal编程技术网

Python ImportError:没有名为_tkinter_finder的模块

Python ImportError:没有名为_tkinter_finder的模块,python,tkinter,pyinstaller,Python,Tkinter,Pyinstaller,我正在使用pyinstaller打包我的应用程序。它创建了二进制文件,但不起作用。当我在终端上加载应用程序时,我看到这个错误 [9854] LOADER: Running BC_GUI_Client.py Traceback (most recent call last): File "FALCON_BC_CLIENT/BC_GUI_Client.py", line 145, in <module> File "PIL/ImageTk.py", line 127, in __

我正在使用
pyinstaller
打包我的应用程序。它创建了二进制文件,但不起作用。当我在终端上加载应用程序时,我看到这个错误

[9854] LOADER: Running BC_GUI_Client.py
Traceback (most recent call last):
  File "FALCON_BC_CLIENT/BC_GUI_Client.py", line 145, in <module>
  File "PIL/ImageTk.py", line 127, in __init__
  File "PIL/ImageTk.py", line 192, in paste
  File "/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py", line 687, in load_module
    module = imp.load_module(fullname, fp, filename, ext_tuple)
ImportError: No module named _tkinter_finder
[9854] Failed to execute script BC_GUI_Client
[9854]加载程序:运行BC\u GUI\u Client.py
回溯(最近一次呼叫最后一次):
文件“FALCON_BC_CLIENT/BC_GUI_CLIENT.py”,第145行,在
文件“PIL/ImageTk.py”,第127行,在_init中__
文件“PIL/ImageTk.py”,第192行,粘贴
加载模块中的文件“/usr/local/lib/python2.7/dist packages/PyInstaller/loader/pyimod03\u importers.py”,第687行
module=imp.load_module(全名、fp、文件名、ext_元组)
ImportError:没有名为_tkinter_finder的模块
[9854]无法执行脚本BC_GUI_客户端
我使用的是python 2.7,安装的是pyinstaller 3.3
这里有什么问题吗?

我可以通过在命令中添加以下选项来运行pyinstaller来解决类似问题:

--hidden-import='PIL._tkinter_finder'
您的命令应如下所示:

pyinstaller module.py --hidden-import='PIL._tkinter_finder'

您能否提供您的规范文件(或为pyinstaller运行的标志)以及pyinstaller构建的输出?它是否正常工作,但在生成exe后失败?你在windows 10上吗?