python 使用pyinstaller进行打包

首先,需要在windows中安装python,并配置环境变量,python的安装地址如下
https://www.python.org/downloads/windows/,首先,必须确定一下,windows的python版本和linux的python是一个版本,这样编译才不会产生错误,安装后,进入CMD.输入python -V,如何显示错误,说明python的环境变量配置有问题,需要手动配置一下环境变量

的![在python 使用pyinstaller进行打包需要将path中增加C:\Python27;C:\Python27\Scripts

然后安装pip,pip相当于linux中的apt-get install工具,要下载
pip 19.0.3 from C:\Python27\lib\site-packages\pip-19.0.3-py2.7.egg\pip (python 2.7)

然后安装pyinstaller ,不要用命令安装
下载pyinstaller3.0的源码,然后执行python setup.py install,
以下是我当前好用的软件列表,使用pip list进行查看
Package Version


altgraph 0.16.1
asn1crypto 0.24.0
backports.functools-lru-cache 1.5
beautifulsoup4 4.7.1
bs4 0.0.1
certifi 2019.3.9
cffi 1.12.3
chardet 3.0.4
cryptography 2.6.1
decorator 4.4.0
dis3 0.1.3
distribute 0.7.3
enum34 1.1.6
future 0.17.1
idna 2.8
ipaddress 1.0.22
jieba 0.39
macholib 1.11
networkx 2.2
numpy 1.13.3
pefile 2019.4.14
Pillow 6.0.0
pip 19.0.3
pycparser 2.19
pyinstaller 3.0
pyOpenSSL 19.0.0
pywin32 224
pywin32-ctypes 0.2.0
requests 2.21.0
setuptools 19.2
six 1.12.0
soupsieve 1.9.1
textrank4zh 0.3
uniout 0.3.7
urllib3 1.24.1

还要安装一个pywin32,具体安装路径自行百度吧

安装号pyinstaller后,用CMD进入到pyinstaller源码所在路径,执行pyinstaller XX/test.py
,其中test.py是入口文件。就会在当前路径下生成
python 使用pyinstaller进行打包其中可执行程序在dist中,可以直接运行
有问题可联系343185482进行探讨