gpt4 book ai didi

linux - 无法打开 Pyinstaller 的输出文件

转载 作者:太空宇宙 更新时间:2023-11-04 11:49:37 24 4
gpt4 key购买 nike

解决方案:

主要问题是由于 ImageTk 引起的,这可以通过使用 tkinter 而不是 PIL.ImageTk 加载图像来跳过,方法是使用此命令并像往常一样使用此对象来使用 PIL.ImageTk .

my_image = PhotoImage(file ="Image location here")

主要问题:

我想用pyinstaller把这些文件打包成一个可执行文件,但是编译后可执行文件没有运行,不知道哪里出错了,文件在给定的链接里,安装登录图片

使用的命令:

pyinstaller --onefile ui.py

其中 ui.py 是我的驱动程序脚本

文件:

https://github.com/RoyalEagle73/NIT-JSR-Result-Leecher/tree/master/GUI%20%2B%20Source%20v2.0/Source

构建日志(图片):

我已经尝试过的

尝试使用 Cx_Freeze 作为替代方案,但似乎没有应用程序可以打开输出文件。

这是我在整个程序中导入的内容

from tkinter import *
from PIL import ImageTk, Image
import fb
from tkinter.ttk import Progressbar
import webbrowser
from tkinter import messagebox
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import re
from bs4 import BeautifulSoup
import time

最佳答案

我无法访问您问题中的 github 链接,我认为它没有正确粘贴。所以我无法访问您的源文件。

尝试其中之一:

 pyinstaller --onefile --noupx ui.py

pyinstaller --debug --onefile --noupx ui.py

pyinstaller 使用 UPX。 documentation对于 pyinstaller 声明如下:

PyInstaller looks for UPX on the execution path or the path specified with the --upx-dir option. If UPX exists, PyInstaller applies it to the final executable, unless the --noupx option was given. UPX has been used with PyInstaller output often, usually with no problems.

希望这对您有所帮助。

关于linux - 无法打开 Pyinstaller 的输出文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56442028/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com