New submission from Hugo Benavides <hugoherna...@gmail.com>:

hi, 
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"  
Aplicacion_Calculadora.py  

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"  
Aplicacion_Calculadora.py 

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\__init__.py", line 4061, in __init__
File "tkinter\__init__.py", 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


Thanks

----------
components: Library (Lib)
files: Aplicacion_Calculadora.zip
messages: 367811
nosy: Hugo Benavides
priority: normal
severity: normal
status: open
title: execution of file with pictures doesn't work in command --onefile in 
pyinstaller
versions: Python 3.8
Added file: https://bugs.python.org/file49103/Aplicacion_Calculadora.zip

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40461>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to