How is the app deciding where to look for the PNG files?

It sounds like it may be using the current working dir -- which is not
ideal.

If you have control of that code, you'll want to use another way to
find them.

I tend to put that kind of thing inside a python package, and use a path
relative to a __file__ in a code file.

You also might be able to use:

import sysif getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
    print('running in a PyInstaller bundle')else:
    print('running in a normal Python process')

and then `sys.executable`

-CHB


On Tue, Aug 5, 2025 at 11:25 AM Karen L <[email protected]>
wrote:

> I packaged some png files but it is not shown in the app, except when I
> start the app from the _internal directory. i.e. /path/to/_internal>
> ../workflow  I put everything in the same directory trying to make it work,
> but it is not working. Is this a bug?  Following is how I make the
> executable and the png files are inside the _internal directory.
>
> pyinstaller -y --clean --onefile --onedir --add-data myapp/resources:.
> --icon myapp.icns myapp/workflow.py
>
> --
> You received this message because you are subscribed to the Google Groups
> "PyInstaller" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/pyinstaller/f69b0797-ab59-4af0-bf4a-62a67d4f1eefn%40googlegroups.com
> <https://groups.google.com/d/msgid/pyinstaller/f69b0797-ab59-4af0-bf4a-62a67d4f1eefn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/pyinstaller/CALGmxELzcRLimMzdMLfz3A80Sv1iQpGt4-z8g%3DJucfw8g1W85w%40mail.gmail.com.

Reply via email to