Python Forum

Full Version: PyInstaller Executable Does Nothing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have read through and tried a bunch of different How-tos on using PyInstaller to turn my python script into an executable but everything I have tried has failed.

I am running Win10, using Python 3.8 and guizero I wrote a very simple GUI that shows the current Julian date. It runs as it should on my computer but I need to create an executable so I can drop it on a bunch of other mixed versions of Windows computers and I don't want to install Python in order to use.

I found PyInstaller and ran it. It created an executable but when I run it all it does is pop up a command prompt for a second then it goes away and does nothing else. It does this on any computer, including my development PC.

What could I be doing wrong?
Instead by double-click, open cmd and run the exe from there, so you will see what error it generates. I guess it is not able to find some import (guizero?). Probably you will need to help pyinstaller find it - e.g. specify hidden-iimport
Ahh! I never thought to run it from the command line.

When I do that, it tells me that tkinter did not import successfully.

I will try my hand at the hidden import.
I modified my hiddenimports
hiddenimports=['guizero','Tkinter']
to my hiddenimports but it still tells me that tkinter did not import successfully.

I have guizero in my site-packages.

Why wouldn't it be importing?
tkinter, not Tkinter?
I tried tkinter first, then tried Tkinter and neither made a difference.
tkinter do not needed to be added in hiddenimports,Pyinstaller find tkinter automatic.
Look at this post there you see i test tkinter with Pyinstaller.
Wall

If PyInstaller gets tkinter automatically what could stop it from importing properly?
can you post the full traceback verbatim? ideally also your code
Here is my code:
from guizero import App, Box, Text
from datetime import date

def get_jdate():
    today = date.today()
    day = today.strftime("%d")
    month = today.strftime("%m")
    year = today.strftime("%y")
    julianday = today.strftime("%j")
    JDate.value = julianday+year
    print("Got Jdate")
    app.update()

appWidth = 200
appHeight = 100
app = App(title="", width=appWidth, height=appHeight, bg="#AFAFAF")
JLable = Text(app, size=15, text="Julian Date")
JDate = Text(app, size=40)
get_jdate()
app.repeat(900000, get_jdate)

app.display()
What exactly do you mean by the full traceback? :)
Pages: 1 2