简体   繁体   English

PyInstaller生成的exe文件不起作用

[英]The exe file generated by PyInstaller does not work

PyInstaller previously worked very well. PyInstaller以前运行良好。 However, after installing Jupyter, the new generated exe files by PyInstaller did not work,for instance, warning no module named Tkinter. 但是,安装Jupyter后,PyInstaller生成的新exe文件无法正常工作,例如,警告没有名为Tkinter的模块。 If uninstall Jupyter and generate the exe file by PyInstaller again, the new exe file works well. 如果卸载Jupyter并通过PyInstaller再次生成exe文件,则新的exe文件将运行良好。

Is there any conflict between the two? 两者之间有冲突吗? How to solve this problem? 如何解决这个问题呢? I want to keep Jupyter installed. 我想保持Jupyter安装。

Solved by changing the modules' order. 通过更改模块的顺序解决。

Old order: from Tkinter import * import tkFileDialog import matplotlib.pyplot as plt import numpy as np import PIL.Image import pylab from matplotlib.colors import LightSource, Normalize,LinearSegmentedColormap 旧命令:从Tkinter导入*导入tkFileDialog导入matplotlib.pyplot作为plt导入numpy作为np导入PIL.Image从matplotlib.image导入pylab从颜色导入LightSource,Normalize,LinearSegmentedColormap

New order: import matplotlib.pyplot as plt import numpy as np import PIL.Image import pylab from matplotlib.colors import LightSource, Normalize,LinearSegmentedColormap from Tkinter import * import tkFileDialog 新订单:从matplotlib.pyplot作为plt导入numpy作为np导入PIL.Image从matplotlib.colors导入pylab从Tkinter导入LightSource,Normalize,LinearSegmentedColormap导入*导入tkFileDialog

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM