Issues packing into Windows EXE #84

Closed
DSMTurboAWD opened this Issue Jan 12, 2017 · 8 comments

Comments

Projects
None yet
4 participants
@DSMTurboAWD

I am not certain if this is an issue with appJar or an issue with the EXE creator (Pyinstaller) but my appgui.py program works great in the IDE and when executing python appgui.py
However, when I pack the script into an EXE, I get an exception running the script related to the appJar favicon... stuff.
Again, I apologize if this is not in the right place, or if I should post on pyinstaller, I am just trying to figure out what is choking where.

Here is the console output when running the script:

C:\Users\_User_>C:\temp\fileCreatorGUI\fileCreatorGUI.exe
Traceback (most recent call last):
  File "F:\Users\_User_\python_working\fileCreatorGUI.py", line 73, in <module>
    app = gui()
  File "C:\Users\_User_\AppData\Local\Programs\Python\Python35\lib\site-packages\appJar\appjar.py", line 509, in __init__
    self.topLevel.wm_iconbitmap(self.appJarIcon)
  File "C:\Users\_User_\AppData\Local\Programs\Python\Python35\lib\tkinter\__init__.py", line 1716, in wm_iconbitmap
    return self.tk.call('wm', 'iconbitmap', self._w, bitmap)
_tkinter.TclError: bitmap "C:\temp\fileCreatorGUI\appJar\resources\icons\favicon.ico" not defined
Failed to execute script fileCreatorGUI

I can supply the full source if necessary, though it does not seem to be blowing up inside my actual script.

@DSMTurboAWD

This comment has been minimized.

Show comment
Hide comment
@DSMTurboAWD

DSMTurboAWD Jan 12, 2017

NOTE:
Packing into an executable (non-windows) on Linux works perfectly without issue, and script can be executed without issue

DSMTurboAWD commented Jan 12, 2017

NOTE:
Packing into an executable (non-windows) on Linux works perfectly without issue, and script can be executed without issue

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 12, 2017

Owner

Interesting, have never tried packing into an executable!

The error looks to be that appJar is trying to load the default appJar icon, but can't find it. I would guess that Pyinstaller hasn't included the resources folder? You could try adding resources/icons/favicon.bmp to however the packaging process works.

appJar only adds a default icon on Windows, as Mac/Linux work in a slightly different way...

An alternative, would be to comment out lines 508/509 in appjar.py, to disable the icon

Owner

jarvisteach commented Jan 12, 2017

Interesting, have never tried packing into an executable!

The error looks to be that appJar is trying to load the default appJar icon, but can't find it. I would guess that Pyinstaller hasn't included the resources folder? You could try adding resources/icons/favicon.bmp to however the packaging process works.

appJar only adds a default icon on Windows, as Mac/Linux work in a slightly different way...

An alternative, would be to comment out lines 508/509 in appjar.py, to disable the icon

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 12, 2017

Owner

Feature request - should be possible to disable default icon on Windows, maybe it should be disabled by default, as it's not set on other platforms.

Owner

jarvisteach commented Jan 12, 2017

Feature request - should be possible to disable default icon on Windows, maybe it should be disabled by default, as it's not set on other platforms.

@DSMTurboAWD

This comment has been minimized.

Show comment
Hide comment
@DSMTurboAWD

DSMTurboAWD Jan 13, 2017

Commenting out the lines fixed it.
There is a function in Pyinstaller that does allow you to add paths to the packaging process but even adding it explicitly, it still choked. I am not certain why, though I have not beat on it anymore to find out.

Commenting out the lines fixed it.
There is a function in Pyinstaller that does allow you to add paths to the packaging process but even adding it explicitly, it still choked. I am not certain why, though I have not beat on it anymore to find out.

@jacobthetechy

This comment has been minimized.

Show comment
Hide comment
@jacobthetechy

jacobthetechy Jan 13, 2017

Contributor

I had this issue yesterday coincidentally, and fixed it by commenting out lines 349 & 350.

The error I had gotten was this.

Traceback (most recent call last):
  File "<string>", line 204, in <module>
  File "site-packages\appJar\appjar.py", line 350, in __init__
  File "lib-tk\Tkinter.py", line 1694, in wm_iconbitmap
_tkinter.TclError: bitmap "C:\Users\USER\Projects\SENSOR~1\dist\app\appJar\resources\icons\favicon.ico" not defined
app returned -1

Tho I was using python 2.7.

EDIT: I should also note that, that I was having other issues with pyinstaller, and had to use v:3.1 to get them resolved.

Contributor

jacobthetechy commented Jan 13, 2017

I had this issue yesterday coincidentally, and fixed it by commenting out lines 349 & 350.

The error I had gotten was this.

Traceback (most recent call last):
  File "<string>", line 204, in <module>
  File "site-packages\appJar\appjar.py", line 350, in __init__
  File "lib-tk\Tkinter.py", line 1694, in wm_iconbitmap
_tkinter.TclError: bitmap "C:\Users\USER\Projects\SENSOR~1\dist\app\appJar\resources\icons\favicon.ico" not defined
app returned -1

Tho I was using python 2.7.

EDIT: I should also note that, that I was having other issues with pyinstaller, and had to use v:3.1 to get them resolved.

jarvisteach added a commit that referenced this issue Jan 13, 2017

Quick fix for missing icon on Windows (#84)
Add code to deal with missing icon file in windows - catch the
exception and ignore it

@jarvisteach jarvisteach added the bug label Jan 13, 2017

@jarvisteach jarvisteach self-assigned this Jan 13, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 21, 2017

Owner

New version released (0.041) with error handling for missing windows icon

Owner

jarvisteach commented Jan 21, 2017

New version released (0.041) with error handling for missing windows icon

@marks

This comment has been minimized.

Show comment
Hide comment
@marks

marks Mar 11, 2017

@DSMTurboAWD / @jarvisteach - how were you packaging into a exe and whats the right way to do this for Mac .app files?

marks commented Mar 11, 2017

@DSMTurboAWD / @jarvisteach - how were you packaging into a exe and whats the right way to do this for Mac .app files?

@DSMTurboAWD

This comment has been minimized.

Show comment
Hide comment
@DSMTurboAWD

DSMTurboAWD Mar 11, 2017

@marks http://www.pyinstaller.org/
It works in Linux, so in theory it will work in MacOS

@marks http://www.pyinstaller.org/
It works in Linux, so in theory it will work in MacOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment