Python Forum
PyInstaller Executable Does Nothing - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: PyInstaller Executable Does Nothing (/thread-32551.html)

Pages: 1 2


PyInstaller Executable Does Nothing - pdihawk - Feb-17-2021

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?


RE: PyInstaller Executable Does Nothing - buran - Feb-17-2021

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


RE: PyInstaller Executable Does Nothing - pdihawk - Feb-17-2021

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.


RE: PyInstaller Executable Does Nothing - pdihawk - Feb-17-2021

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?


RE: PyInstaller Executable Does Nothing - deanhystad - Feb-17-2021

tkinter, not Tkinter?


RE: PyInstaller Executable Does Nothing - pdihawk - Feb-17-2021

I tried tkinter first, then tried Tkinter and neither made a difference.


RE: PyInstaller Executable Does Nothing - snippsat - Feb-17-2021

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.


RE: PyInstaller Executable Does Nothing - pdihawk - Feb-17-2021

Wall

If PyInstaller gets tkinter automatically what could stop it from importing properly?


RE: PyInstaller Executable Does Nothing - buran - Feb-17-2021

can you post the full traceback verbatim? ideally also your code


RE: PyInstaller Executable Does Nothing - pdihawk - Feb-17-2021

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? :)