|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
把打飞机程序封装完,出现dist和build两个文件夹,dist中出现两个文件:main(无后缀)、main.app,但是这两个都无法运行,双击没有反应。
dist文件夹内容如图,
dist文件夹
,build\main文件夹内容如图
build\main文件夹
最后附终端中pyinstaller的命令以及提示
- luo@luodeMacBook-Pro 我写的打飞机 % pyinstaller -F -w main.py
- 102 INFO: PyInstaller: 6.2.0
- 102 INFO: Python: 3.12.0
- 108 INFO: Platform: macOS-14.0-arm64-arm-64bit
- 108 INFO: wrote /Users/luo/Documents/我写的打飞机/main.spec
- 111 INFO: Extending PYTHONPATH with paths
- ['/Users/luo/Documents/我写的打飞机']
- pygame 2.5.2 (SDL 2.28.3, Python 3.12.0)
- Hello from the pygame community. https://www.pygame.org/contribute.html
- 219 INFO: checking Analysis
- 219 INFO: Building Analysis because Analysis-00.toc is non existent
- 219 INFO: Initializing module dependency graph...
- 220 INFO: Caching module graph hooks...
- 224 INFO: Analyzing base_library.zip ...
- 588 INFO: Loading module hook 'hook-heapq.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 637 INFO: Loading module hook 'hook-encodings.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 1426 INFO: Loading module hook 'hook-pickle.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 2077 INFO: Caching module dependency graph...
- 2112 INFO: Running Analysis Analysis-00.toc
- 2112 INFO: Looking for Python shared library...
- 2114 INFO: Using Python shared library: /Library/Frameworks/Python.framework/Versions/3.12/Python
- 2114 INFO: Analyzing /Users/luo/Documents/我写的打飞机/main.py
- 2130 INFO: Loading module hook 'hook-pygame.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pygame/__pyinstaller'...
- pygame 2.5.2 (SDL 2.28.3, Python 3.12.0)
- Hello from the pygame community. https://www.pygame.org/contribute.html
- 2236 INFO: Loading module hook 'hook-pkg_resources.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 2565 INFO: Loading module hook 'hook-platform.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 2581 INFO: Loading module hook 'hook-xml.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 2595 INFO: Loading module hook 'hook-sysconfig.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 2628 INFO: Processing module hooks...
- 2866 INFO: Loading module hook 'hook-platformdirs.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
- 2884 INFO: Loading module hook 'hook-packaging.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 3113 INFO: Looking for ctypes DLLs
- 3120 INFO: Analyzing run-time hooks ...
- 3121 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
- 3122 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
- 3124 INFO: Including run-time hook '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
- 3126 INFO: Processing pre-find module path hook _pyi_rth_utils from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks/pre_find_module_path/hook-_pyi_rth_utils.py'.
- 3126 INFO: Loading module hook 'hook-_pyi_rth_utils.py' from '/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks'...
- 3129 INFO: Looking for dynamic libraries
- 3243 INFO: Warnings written to /Users/luo/Documents/我写的打飞机/build/main/warn-main.txt
- 3250 INFO: Graph cross-reference written to /Users/luo/Documents/我写的打飞机/build/main/xref-main.html
- 3321 INFO: checking PYZ
- 3321 INFO: Building PYZ because PYZ-00.toc is non existent
- 3321 INFO: Building PYZ (ZlibArchive) /Users/luo/Documents/我写的打飞机/build/main/PYZ-00.pyz
- 3511 INFO: Building PYZ (ZlibArchive) /Users/luo/Documents/我写的打飞机/build/main/PYZ-00.pyz completed successfully.
- 3513 INFO: EXE target arch: arm64
- 3513 INFO: Code signing identity: None
- 3515 INFO: checking PKG
- 3515 INFO: Building PKG because PKG-00.toc is non existent
- 3515 INFO: Building PKG (CArchive) main.pkg
- 7134 INFO: Building PKG (CArchive) main.pkg completed successfully.
- 7135 INFO: Bootloader /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/bootloader/Darwin-64bit/runw
- 7135 INFO: checking EXE
- 7135 INFO: Building EXE because EXE-00.toc is non existent
- 7135 INFO: Building EXE from EXE-00.toc
- 7135 INFO: Copying bootloader EXE to /Users/luo/Documents/我写的打飞机/dist/main
- 7136 INFO: Converting EXE to target arch (arm64)
- 7146 INFO: Removing signature(s) from EXE
- 7158 INFO: Appending PKG archive to EXE
- 7162 INFO: Fixing EXE headers for code signing
- 7167 INFO: Re-signing the EXE
- 7198 INFO: Building EXE from EXE-00.toc completed successfully.
- 7200 INFO: checking BUNDLE
- 7200 INFO: Building BUNDLE because BUNDLE-00.toc is non existent
- 7200 INFO: Building BUNDLE BUNDLE-00.toc
- 7203 INFO: Signing the BUNDLE...
- 7236 INFO: Building BUNDLE BUNDLE-00.toc completed successfully.
复制代码 |
|