简体   繁体   English

Pyinstaller 运行 exe 文件时出错

[英]Pyinstaller Error when running the exe file

I wrote python script which include tkinter, sqllite3, matplotlib and other libraries.我编写了 python 脚本,其中包括 tkinter、sqllite3、matplotlib 和其他库。 When I bundle the script to exe file by using pyinstaller, it's finished successfully but when I run the exe file it's giving me this error:当我使用 pyinstaller 将脚本捆绑到 exe 文件时,它已成功完成,但是当我运行 exe 文件时,它给了我这个错误:我得到的错误

Need to mention that I don't use any library name babel.需要提一下,我没有使用任何库名 babel。 I also add my code to the application below:我还将我的代码添加到下面的应用程序中:


# Core PackAages
import tkinter as tk
from tkinter import *
from tkinter import ttk
from tkinter.scrolledtext import *
import tkinter.filedialog
from tkcalendar import Calendar, DateEntry
from tkinter import messagebox
from tkintertable import TableCanvas, TableModel
from tkinter import ttk
import matplotlib.pyplot as plt
from fpdf import FPDF

#background


# Database
import sqlite3
import csv


You seem to have similar problem as here .你似乎和这里有类似的问题。 The solution is simple, add hidden import:解决方法很简单,添加隐藏导入:

pyinstaller.exe --hidden-import babel.numbers script.py

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

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