PyInstaller库能将用python语言写的代码打包可以直接执行的exe文件,便于在windows系统上操作。
1、系统环境:python 版本 Python 3.6.4
2、pip install pyinstaller 报错:
Command "d:\anaconda35\python.exe d:\anaconda35\lib\site-packages\pip_vendor\pe
p517_in_process.py get_requires_for_build_wheel C:\Users\Public\Docu
ments\Wondershare\CreatorTemp\pip-req-build-2jmqy8ou
3、解决方法:
因pyinstaller 依赖pywin32,在安装前,需要先安装该软件包。
D:\python-install\Scripts>pip install pywin32
官网下载安装包 PyInstaller-3.4.tar.gz
http://www.pyinstaller.org/downloads.html
解压,放在 python 安装目录下
到安装目录下执行:python setup.py install
D:\python-install\PyInstaller-3.4>python setup.py install
安装成功后查看相应版本。
D:\python-install\PyInstaller-3.4>pyinstaller --version
3.4
4、cmd 命令行查看该命令
C:\Users\>pyinstaller -h
usage: pyinstaller [-h] [-v] [-D] [-F] [--specpath DIR] [-n NAME]
[--add-data ]
[--add-binary ] [-p DIR]
[--hidden-import MODULENAME]
[--additional-hooks-dir HOOKSPATH]
[--runtime-hook RUNTIME_HOOKS] [--exclude-module EXCLUDES]
[--key KEY] [-d [{all,imports,bootloader,noarchive}]] [-s]
[--noupx] [-c] [-w]
[-i ]
[--version-file FILE] [-m ] [-r RESOURCE]
[--uac-admin] [--uac-uiaccess] [--win-private-assemblies]
[--win-no-prefer-redirects]
[--osx-bundle-identifier BUNDLE_IDENTIFIER]
[--runtime-tmpdir PATH] [--bootloader-ignore-signals]
[--distpath DIR] [--workpath WORKPATH] [-y]
[--upx-dir UPX_DIR] [-a] [--clean] [--log-level LEVEL]
scriptname [scriptname ...]
.....
5、出现帮助信息,则该命令已经成功安装。