Python - troubleshooting .exe file compiled from Python

Dear Experts,

I have a Python code which surely works correctly running from the console in Anaconda (one of the Python IDE)

My target is to create from this .py file and .exe, for that installed PyInstaller and created the .exe.

However running that .exe there can be just seen a fast flashing on the screen (like the cmc Command Prompt window it seems) and the code stops who knows where, no any error message or information where stopped.

Could you please point out some possibilities, how to troubleshoot issues in such generated .exe file containing Python code?

Thanks in advance,
csehzIT consultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

issues like this can be best debugged from a cmd window.

Let's assume, that your exe file is located in c:\Users\cshez\dist

then start a cmd window
and type
cd /d c:\Users\cshez\dist

Open in new window

let's assume your executable is called mytest.exe

just type  mytest.exe in the cmd window
now you should be able to see the output and hopefully the error message gives you some hints

what you could also try is to run your python script from the command line.

just cd into the right directory
and type
(assuming is the name of your script)

Most scripts I wrote work quite well with pyinstaller or py2exe, but some need a little tuning / minor modifications to be working.

I might help if I see the error message

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
csehzIT consultantAuthor Commented:
Thank you trying this general method helped me a lot to understand how it works.

Anyway concretely the .exe in the question started to work after a computer restart, so everything is fine without the need of modification
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.