mac install pyinstaller and package

The same applies to windows
**

1. Installation

**
First open the terminal input and
install via mirror is faster

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyinstaller

Insert picture description here
Waiting for the progress bar to finish
re-enter

pyinstaller --version

Insert picture description here
ok installation complete
**

2. Packaging

**
1 Find the file path to be packaged
mac and drag the file directly to the terminal to get the path

2 cd to the path

3 The pyinstaller -F -w main.py
following error was reported when entering mac packaging in the terminal

Unable to find "/anaconda3/lib/python3.6/site-packages/PyQt5/Qt/lib/QtWebEngineCore.framework/Resources" when adding binary and data files

Insert picture description here
Baidu took a look at the solution after installing the QtWebEngineWidgets library and repacking it

pip install PyQtWebEngine

After the installation is complete, try to package input

pyinstaller -F -w main.py

Another process is waiting for packaging ...
ps: Yellow is my computer name or project name, just ignore it, mainly look at the red area
Insert picture description here
and then succeed! ! ! ! ! !

When you enter the directory, you will see that the dist file is opened. There is a main in it. Click on the program and it will run.
Insert picture description here

Published 41 original articles · Likes2 · Visits 1836

Guess you like

Origin blog.csdn.net/weixin_43883485/article/details/104559013