How to package pycharm files into exe? Pycharm’s skills in packaging exe executable files

Time:2021-10-10

How to package the program into exe under pycharm? In the development environment, we can run directly through pycharm. When we complete a program, we need to execute it in an independent environment. Therefore, we need to package the. Py program into an EXE file that can be executed directly in the windows environment. What should we do? Let’s take a look at the detailed tutorial.

Method 1:

1. First, open the project you want to publish

2. Click at the bottom【Terminal】Open the terminal and enter the command in thepip install pyinstallerPress enter and install as shown in the figure

3. Enter the command pyinstallerPress enter to display that the installation is successful

4. Enter the command pyinstaller –console –onefile jingyan_frame.py, as shown in the figure, it is published successfully

5. Under the project directory/There will be packaged exe files in the dist folder, as shown in the figure

6. After double clicking the EXE file, the running results are as follows:

Method 2:

1. Install the plug-in pyinstaller in pycharm

2. Call out the terminal, enter the command pyinstaller – F – w vipvideoplay2.py and click enter

As shown in the figure: after entering the specified command, the dist folder will be produced in the current directory, and the generated EXE file will be in the dist folder

Parameter Description:

-F: Package all library files into one exe

-w: Hide black console window

If the – f parameter is not added, many files will be generated, but the operation is faster. Compressed is a little smaller than a single EXE file

Adding the – f parameter only generates an EXE file, but it runs slowly

Copyright notice: This article is the original article of CSDN blogger “garry1115”,

Original link: https://blog.csdn.net/zwx19921215/article/details/85234801

The above is about pycharmwe’s skills of turning your package into exe. I hope you like it. Please continue to pay attention to developpaer.

Relevant recommendations:

How does pycharm create associated files? Tips for creating Python files with pycharm