Yorik Callil2019-09-27 04:12:29
Yorik Callil, 2019-09-27 04:12:29

After creating an .exe, a part of the program cannot be executed due to an error, how to fix it?

There were .py files
As usual, the main main.py has other files already included in it.
I also want to note that I used GUI - QT.
GUI files are also converted to .py
The essence of the program is that it creates a .txt file in which names are written and the
date of creation is allowed (not the essence of what we write there)
After all the names are re-sorted into a new .txt file, in date order.
And all this is displayed in a window created specifically for this action.
As a result, if you run through IDLE or PyCharm, everything works fine! And without mistake!
Of these (.py files) a single .exe file was created using pyinstallera (with the flag, -F)
Now if we run the .exe file, it opens normally, but when the actions are performed, it does not perform its functions (but if we close the program and turn it on again, the sorting action was completed ...)
Error windows (with GUI) are not shown at all, just silence ..
Let 's say , I have fields, and if one of them is empty, and press the ADD button - then it displays a window with a description of the error.
We look in the console and see: "module name" (any other) is not an internal or external command, executable program or file package.

And so for each module, except for the main one (main.py - it launches it), everything else does not work ..
But in fact - this is a utility. She creates txt documents next to her and works in them.
How to fix this error?
After all, everything works correctly with IDLE.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Alexander, 2019-09-27

Apparently the structure of the program (calling modules) is not done correctly, since it gives such errors. The program should be implemented according to the OOP principle, and not according to the scenario.

Andrey_Dolg, 2019-09-27

It's hard to talk without code, but there are a couple of things to keep in mind when working with files in pyindtaller.
1) Not everything that the program needs will be packed, and not infrequently, some of the files will need to be written to the build spec yourself.
2) Your program at runtime is in a temporary directory ("/tmp/_MEI34121" as an example) because of which you need to work a little differently with file paths.
"module name" (any other) is not an internal or external command, operable program, or package of files"
Visually, they are called in cmd as commands why the question is for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question