This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: execution of file with pictures doesn't work in command --onefile in pyinstaller
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Hugo Benavides, ned.deily
Priority: normal Keywords:

Created on 2020-04-30 23:48 by Hugo Benavides, last changed 2022-04-11 14:59 by admin. This issue is now closed.

File name Uploaded Description Edit Hugo Benavides, 2020-04-30 23:48
Messages (2)
msg367811 - (view) Author: Hugo Benavides (Hugo Benavides) Date: 2020-04-30 23:48
I have a problem to crete an executable using the command pyinstaller at the time of use the helper --onefile

I've created an executable using the next instruction:

pyinstaller --windowed --add-data "Rute PC to my Folder\Imagen";"Imagen"  

The folder Imagen has an imagen that is called into the code and at this time everything work fine, the executable starts and works very fine. I have used the calculator and operations are correct and the imagen is upload in the interface, but I deleted everything and started again.

I would like to add everything in one File using the command:

pyinstaller --onefile --add-data "Rute PC to mi Folder\Imagen";"Imagen" 

At this point, the executable never starts. If I saw the message in console when the .exe is running and it shows me the next error: 

File "tkinter\", line 4061, in __init__
File "tkinter\", line 4006, in __init__
_tkinter.TclError: couldn't open "./Imagen/Retroceder.png": no such file or directory [11320] Failed to execute script Aplicacion_Calculadora 

The executable never can find the folder and the imagen, it happenning just when I use the command --onefile

I've been looking in every documentation and instructions but I've not found anything about that error just using the command --onefile

May you help me with that error or what instruction I should add, please?

Attach code and folder with the imagen

msg367910 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-05-02 03:37
PyInstaller is a third-party project, not part of the Python Standard Library.  I suggest you start with their documentation here:
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84641
2020-05-02 03:37:15ned.deilysetstatus: open -> closed

type: enhancement

nosy: + ned.deily
messages: + msg367910
resolution: third party
stage: resolved
2020-04-30 23:48:45Hugo Benavidescreate