PyInstaller raw script into an executable file

Installation PyInstaller

pip3 install pyinstaller

View pyinstaller --version version

Use PyInstaller

pyinstaller --help to see all usage

The simplest usage, execute commands in the same directory and test.py: pyinstaller test.py

9087481-2dffaf81bd4ca9bb.png

Then see the new addition of two directories build and dist, dist following file is an executable file that can be published, for the above command you will find the dist directory under a pile of papers, all kinds of dynamic libraries are executable and myscrip file. Sometimes it feels too much trouble, you need to package all dist following things to post, in case of losing a dynamic library will not run, but fortunately pyInstaller support single file mode, only you need to do:

pyinstaller -F test.py

Here you will find dist only one executable file, this single file can be released, it can be run under a similar system operating system you are using.

9087481-534b9b30544ca3b1.png

Reproduced in: https: //www.jianshu.com/p/f01e8df3f62a

Guess you like

Origin blog.csdn.net/weixin_34236497/article/details/91121568