Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.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 Pyinstaller错误,尚未在IDE中使用名为Tkinter的模块_Python_Python 2.7_Tkinter_Python Import_Pyinstaller - Fatal编程技术网

Python Pyinstaller错误,尚未在IDE中使用名为Tkinter的模块

Python Pyinstaller错误,尚未在IDE中使用名为Tkinter的模块,python,python-2.7,tkinter,python-import,pyinstaller,Python,Python 2.7,Tkinter,Python Import,Pyinstaller,我知道以前有人问过这个问题,但很遗憾,添加,--hiddenimport=Tkinter的解决方案对我不起作用 我的脚本在IDE中运行时没有错误。该脚本包括一个Tkinter窗口、一个使用suds的webservice调用,以及使用openpyxl将数据放入excel 我一直在尝试在cmd中运行此命令: pyinstaller --onefile --onedir --hiddenimport=Tkinter my_script.py 它创建了一个exe,但它不运行,当我在cmd中运行它时,它

我知道以前有人问过这个问题,但很遗憾,添加,
--hiddenimport=Tkinter
的解决方案对我不起作用

我的脚本在IDE中运行时没有错误。该脚本包括一个Tkinter窗口、一个使用suds的webservice调用,以及使用openpyxl将数据放入excel

我一直在尝试在cmd中运行此命令:

pyinstaller --onefile --onedir --hiddenimport=Tkinter my_script.py
它创建了一个exe,但它不运行,当我在cmd中运行它时,它说

ImportError: No module named Tkinkter

让我猜猜。。。你使用IDLE作为IDE吗?我使用的是PyScripterOk。你应该在问题的主体部分提到这一点。看起来PyScripter正在使用Tkinter本身(IDLE也会这样做)。顺便说一句:PyScripter可以创建
--onefile
--onedir
,而不是同时创建两者
--onedir
创建包含所有文件的目录,您可以将这些文件复制到另一台计算机上运行,然后查看找到的文件
--onefile
获取相同的文件并使用这些文件创建self-executable.ZIP。