pyinstaller打包exe方法,以django为例

  1. 注意:
  2. 安装pyinstaller,运行pip install pyinstaller

  3. 安装pyqt包,运行pip install PyQt5


  4. cd进项目文件夹地址

  5. 运行pyi-makespec -D manage.py,生成manage.spec

  6. 运行pyinstaller manage.spec

  7. 运行pyinstaller --clean --win-private-assemblies -F manage.py

  8. 故障:1909 INFO: UPX is not available. 解决方法:【python 问题解决】 ---- UPX is not available._Rattenking的博客-CSDN博客_python upx安装

  9. 故障:1867 WARNING: Failed to collect submodules for 'django.contrib.postgres.forms' because importing 'django.contrib.postgres.forms' raised: ModuleNotFoundError: No module named 'psycopg2' 解决方法:pip install psycopg2

  10. 故障:TypeError: expected str, bytes or os.PathLike object, not NoneType 解决方法:C:\Users\XXX\anaconda3\Lib\ntpath.py  185行改为p = os.fspath(str(p))

猜你喜欢

转载自blog.csdn.net/Cecidit_824/article/details/127987437