How the python3.x program is packaged as an EXE executable file

Source: Internet
Author: User

Recently, I was asked how to package python as an EXE program. pyinstaller3.3 is installed using PIP install Pyinstaller. I found a tutorial on the Internet, packaged the program as an EXE file, but there was a failed to execute XXX error while executing the file. Later found that should be in the program to refer to the picture and other paths out of error, while in the packaged EXE file path should also be placed under the referenced image. Close-up this article, for students who encounter this problem reference.

Found in the code, the path of the ICO icon is an absolute path, this time I suddenly understand, will not be, pyinstaller in the packaging when the ICO pack in, generate EXE file sent to others, and then this path can not be found, and then the program began to error! With hope, quickly change the path to a relative path!

Running ok! in the IDE No problem, you can open it and start using Pyinstaller to package the build exe!

After a while in the directory generated disc folder, there is a good exe file generated, God bless, must be successful. After running ... I'm a man! Error, haha and before the error is identical, no problem! After generating the EXE has not been copied in the ICO folder, relative path must not find Ah! The ICO file is copied in the previous relative path below! Then run, ok! Perfect execution!

How the python3.x program is packaged as an EXE executable file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.