Python,CX冻结错误,当我尝试启动exe时

问题描述 投票:1回答:2

你好

我尝试学习Python ...我自己做了一个小软件,用于从XLSX读取数据,当我以“正常方式”启动> / python方式启动时,所有东西都运行良好(ctrl + B为高品质文字)。...但是...当我将其编译为使用“ cx.freeze”获取我的“ .exe”时,以及启动我的.exe时,都会显示此错误窗口:

([https://i.stack.imgur.com/E2GVw.png

我尝试使用图书馆询问我是否更新了所有图书馆,但什么也没有

这里是我的代码的开头和结尾,以及PIP安装的库:

# c-*- coding: utf-8 -*-
# Bibliotheques
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import openpyxl
import xlrd
import mpl_toolkits
import sys
import os
from tkinter import *
from tkinter import messagebox
from tkinter.filedialog import *  # askopenfilename
from functools import partial
from PIL import Image, ImageTk

class MyApp(Tk):  # --- Class.N°1 --- #
    def __init__(self):
        Tk.__init__(self)


if __name__ == '__main__':
    MyApp()

这里是我使用的CX.freeze scrypt:


from cx_Freeze import setup, Executable
import os.path

PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')

base = "Win32GUI" #pour appli graphique ss windows
#base = "console" #pour appli console

options = {
   'build_exe': {
       'include_files':[
           os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
           os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
       ],
   },
}

# On appelle la fonction setup
setup(name = "GraphEditor",
   options = options,
   version = "V1.1.2",
   author = "Scorn",
   description = "Reading and editing trends from 2D table",
   executables = [Executable("GraphEditor.py",base=base, icon="xln.ico")]
)

所以我的问题是:为什么我有此错误,以及如何解决它?

感谢您的时间和回答:)

您好,我尝试学习Python ...我自己做了一个小的软件,用于从XLSX读取数据,当我以“常规方式/ python方式”(崇高文本中的ctrl + B)启动时,一切运行良好。 ...但...

python pandas matplotlib tkinter cx-freeze
2个回答
0
投票

我发现CXFreeze在许多情况下效果不佳。所以我更喜欢使用Nuitka


0
投票

我解决了我的问题。

© www.soinside.com 2019 - 2024. All rights reserved.