【问题标题】:Having trouble making a working exe using Pyinstaller for my file使用 Pyinstaller 为我的文件制作工作 exe 时遇到问题
【发布时间】:2021-10-02 20:01:28
【问题描述】:

我有一个简单的代码,我正试图将它制作成一个 .exe 文件。该文件已导入 tkinter 和 pandastable,并且还从名为 list_of_games.csv 的 CSV 文件导入。当我尝试运行创建的 exe 文件时,它只是打开命令提示符而没有执行任何其他操作。

我正在尝试使用 .spec 文件制作 exe,其中包含以下隐藏导入和数据(其他所有内容均保留为默认值):

datas=[('list_of_games.csv','.')],  
hiddenimports=['pandas','pandastable','matplotlib.pyplot','os','sys'],  

这是有问题的代码,如果我需要修复它以使其工作:

from tkinter import *
from tkinter import font
from pandastable import Table, config

root = Tk()  
root.geometry("1225x700+150+40")  
root.title('Video Game Database')  

frame = Frame(root, bg='light blue', bd=5)  
frame.pack(fill='both', expand=True)  

table = Table(frame, showtoolbar=True, showstatusbar=True)  
table.autoResizeColumns()  

options = config.load_options()  
options = {'font': 'Calibri',  
             'fontsize': 11,  
             'rowselectedcolor': 'light green',  
             'colheadercolor': 'green'}  
config.apply_options(options, table)  

table.importCSV('list_of_games.csv')  

table.redraw()  
table.show()  

root.mainloop()  

任何人都可以提供任何帮助,我们将不胜感激,谢谢。

【问题讨论】:

    标签: python pandas tkinter pyinstaller exe


    【解决方案1】:

    尝试添加新版本的 Auto-Py-To-Exe Auto-Py-To-Exe

    然后从 GitHub 下载 Zip 文件

    GitHub

    然后使用该 .exe 文件将您的 .Py 文件转换为其 Exe 应用程序

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-20
      • 2015-02-13
      • 2022-06-14
      • 2013-06-12
      • 2021-12-20
      • 1970-01-01
      • 2019-11-17
      • 1970-01-01
      相关资源
      最近更新 更多