The method of pyinstaller packaging exe

 

simple package command

  1. Open the command line in the directory where the file to be packaged is located,
  2. (Advantage: the packaged file will be reduced) or copy the file to be packaged to the Scripts folder under the python installation address, or copy it to the Scripts folder under the virtual project address of the project in pycharm (C:\Users\Administrator \GUI_\ Scripts) , and then perform the following step 3
  3. pyinstaller --clean -F -c -i xxx.ico  $file.py$ -p '' $\\GUI_\Lib\site-packages$ ' ' (the address of the third-party library, or the virtual third-party of the project in pycharm library address)

--clean can eliminate the last packaging cache to prevent it from appearing when packaging and running exe

Error loading Python DLL 'D:\PYQT5\Weather\build\WeatherWin\python36.dll'.
LoadLibrary: The specified module could not be found

Using -c instead of -w is to catch the error code for later convenience -

 

Guess you like

Origin blog.csdn.net/zw05011/article/details/93192689