快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

使用Pyinstaller转换.py文件为.exe可执行程序过程详解-创新互联

 前言

目前创新互联公司已为上1000+的企业提供了网站建设、域名、虚拟主机绵阳服务器托管、企业网站设计、上党网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

pyinstaller能够在Windows、Linux等操作系统下将Python脚本打包成可直接运行程序。使Python脚本可以在没有安装Python的环境中直接运行,方便共享。

开发环境


python 2.7.12 + Windows7

注意事项

1、待转换的.py文件绝对路径最好不要包含中文字符。容易出现一些莫名其妙的问题。

2、python中需要有.py文件中用到的第三方库。否则在转换后的.exe文件中会出现不符合预期的结果。

pyinstaller安装步骤


1、配置pip镜像源。pip配置方法参考pip配置和安装第三方模块。如果已经配置,跳过。

2、打开cmd命令行窗口,输入pip install pyinstaller,安装pyinstaller库。

C:\Users\Administrator>pip install pyinstaller
Collecting pyinstaller
 Downloading http://pypi.doubanio.com/packages/3c/86/909a8c35c5471919b3854c01f43843d9b5aed0e9948b63e560010f7f3429/PyIns
taller-3.3.1.tar.gz (3.5MB)
  100% |████████████████████████████████| 3.5MB 112kB/s
Requirement already satisfied: setuptools in c:\python27\lib\site-packages (from pyinstaller)
Requirement already satisfied: pefile>=2017.8.1 in c:\python27\lib\site-packages (from pyinstaller)
Requirement already satisfied: macholib>=1.8 in c:\python27\lib\site-packages (from pyinstaller)
Requirement already satisfied: dis3 in c:\python27\lib\site-packages (from pyinstaller)
Requirement already satisfied: future in c:\python27\lib\site-packages (from pyinstaller)
Requirement already satisfied: altgraph>=0.15 in c:\python27\lib\site-packages (from macholib>=1.8->pyinstaller)
Installing collected packages: pyinstaller
 Running setup.py install for pyinstaller ... done
Successfully installed pyinstaller-3.3.1

分享标题:使用Pyinstaller转换.py文件为.exe可执行程序过程详解-创新互联
标题URL:http://6mz.cn/article/cschdd.html

其他资讯