Python安装pyinstaller方法,以及将项目生成可执行程序的步骤
pyinstaller安装方法
前提:确保计算机安装了Python语言环境,并且正确配置了环境变量。
方法一:联网在线自动安装
选择一 Windows OS下进入cmd(命令行窗口) 输入:pip install pyinstaller
选择二 在Pycharm IDE 终端下 输入:pip install pyinstaller
我在Pycharm 终端下安装pyinstaller时,遇到这样的安装错误:
D:\pycharm-workspace>pip install pyinstaller
Collecting pyinstaller
Using cached https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Complete output from command 'd:\python\python.exe' 'd:\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\林芝\AppData\Local\Temp\tmpjsdjh2mc':
ERROR: running dist_info
creating C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info
writing C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\PKG-INFO
writing dependency_links to C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\dependency_links.txt
writing entry points to C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\entry_points.txt
writing requirements to C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\requires.txt
writing top-level names to C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\top_level.txt
writing manifest file 'C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\SOURCES.txt'
reading manifest file 'C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
Error in sitecustomize; set PYTHONVERBOSE for traceback:
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xc1 in position 0: invalid start byte (sitecustomize.py, line 21)
no previously-included directories found matching 'bootloader\build'
no previously-included directories found matching 'bootloader\.waf-*'
no previously-included directories found matching 'bootloader\.waf3-*'
no previously-included directories found matching 'bootloader\waf-*'
no previously-included directories found matching 'bootloader\waf3-*'
no previously-included directories found matching 'bootloader\_sdks'
no previously-included directories found matching 'bootloader\.vagrant'
warning: no previously-included files found matching 'bootloader\.lock-waf*'
no previously-included directories found matching 'doc\source'
no previously-included directories found matching 'doc\_build'
warning: no previously-included files matching '*.tmp' found under directory 'doc'
warning: no files found matching 'news\_template.rst'
no previously-included directories found matching 'news'
no previously-included directories found matching 'old'
no previously-included directories found matching 'scripts'
no previously-included directories found matching 'tests\scripts'
no previously-included directories found matching '.github'
warning: no previously-included files found matching '.*'
warning: no previously-included files found matching '*.yml'
warning: no previously-included files found matching '*~'
warning: no previously-included files found matching '.directory'
writing manifest file 'C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.egg-info\SOURCES.txt'
creating 'C:\Users\林芝\AppData\Local\Temp\pip-install-_cg8f619\pyinstaller\pip-wheel-metadata\PyInstaller.dist-info'
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Command "'d:\python\python.exe' 'd:\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\林芝\AppData\Local\Temp\tmpjsdjh2mc'" failed with error code 1 in C:\Users\林芝\
AppData\Local\Temp\pip-install-_cg8f619\pyinstaller
######################## 终端提示我 命令执行失败,错误代码1 我也不知道这种方法安装失败的原因, 欢迎大家交流讨论#######################
方法二:自主下载pyinstaller包,进行手动安装
pyinstaller 的下载地址:http://www.pyinstaller.org/downloads.html
下载文件后,解压文件。
我的解压路径是: D:\python\pyinstaller-pyinstaller-d740524
windows OS cmd(命令行窗口)进入 解压文件所在的目录。
cd D:\python\pyinstaller-pyinstaller-d740524
D:\
输入: python setup.py install
等待一段时间,pyinstaller就会安装成功
安装成功后,查看一下pyinstaller的版本信息
pyinstaller --version
出现结果如下,证明安装成功!
Python项目生成可执行程序的步骤
选择一:Windows OS下进入cmd(命令行窗口) 输入:pyinstaller -F xx.py xxx.py ......
选择二:在Pycharm IDE 终端下 输入:pyinstaller -F xx.py xxx.py ......
xx.py 和 xxx.py 是要打包的文件名
-F参数的含义是,将多个.py脚本文件打包成为一个可执行程序。
Python安装pyinstaller方法,以及将项目生成可执行程序的步骤的更多相关文章
- python安装模块方法汇总
方法一: 原文地址: http://blog.csdn.net/cighao/article/details/47860041 在 windows 系统下,只需要输入命令 pip install re ...
- python安装pip方法
1.先下载pip安装脚本: https://bootstrap.pypa.io/get-pip.py 2.执行python get-pip.py 3.安装完成.
- python 安装pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
- c#项目调用Python模块的方法
将Python模块用pyinstaller打包成exe程序 下载安装UPX((http://upx.sourceforge.net/)) ,并把路径加到环境变量中. UPX是开源的加壳和压缩exe的程 ...
- PyInstaller安装使用方法
PyInstaller可以把Python应用程序及其所有依赖项捆绑到一个包中.用户可以在不安装Python解释器或任何模块的情况下运行打包的应用程序.PyInstaller支持Python 2.7和P ...
- 在Win8上安装pyinstaller打包python成为可执行文件
首先我使用的电脑系统是: Windows-8-6.2.9200 Python的版本是: 2.7.8 默认已安装python2.7且设置好了环境变量. 仅为个人记录,非教程. 首先先安装pip: 首先先 ...
- IDEA内的SpringBoot插件安装与SpringBoot项目生成地址
最新安装idea,在新建项目时没有spring initializr选项,也没有spring assistant选项.因此需要安装相应插件 在菜单栏 file>>settings>& ...
- 源码安装python +NGINX 的坎坷路 +uwsgi安装 部署django 的CRM项目
一.Nginx安装(基于ubuntu17.10 版本) 首先我们是基于源码安装,主要有如下步骤 1.安装依赖包 1.安装gcc g++的依赖库 sudo apt-get install build-e ...
- 在Eclipse中安装python插件的方法
一个博士给了我一堆代码,原本以为是C++或者java写的,结果是python,我压根没学过呀,不过本着语言都是相通的原则,我硬着头皮开始学习Python,当然先学习安装IDE(以前学习一门新语言,我会 ...
随机推荐
- 正睿OI国庆DAY2:图论专题
正睿OI国庆DAY2:图论专题 dfs/例题 判断无向图之间是否存在至少三条点不相交的简单路径 一个想法是最大流(后来说可以做,但是是多项式时间做法 旁边GavinZheng神仙在谈最小生成树 陈主力 ...
- .net core 3.0 Signalr - 02 使用强类型的Hub
## 强类型的优缺点 - 优点 强类型的Hub可以避免魔法函数名,相比弱类型更容易维护和发现问题,直接上代码 - 缺点 特么的得多些好几行代码 ## 代码 ### 接口定义 ``` C# /// // ...
- WebGL简易教程(六):第一个三维示例(使用模型视图投影变换)
目录 1. 概述 2. 示例:绘制多个三角形 2.1. Triangle_MVPMatrix.html 2.2. Triangle_MVPMatrix.js 2.2.1. 数据加入Z值 2.2.2. ...
- Java 学习笔记之 实例变量非线程安全
实例变量非线程安全: 如果多个线程共同访问1个对象中的实例变量,则可能出现“非线程安全”问题. public class UnSafeHasSelfPrivateNum { private int n ...
- C# 8 的模式匹配
C# 7 里面的Pattern Mathing is 模式 switch 和 when C# 8 里面的Pattern Matching 使用Deconstructor 和 位置匹配模式 下面两个类T ...
- GDB使用总结
1. GDB概述 GNU发布的调试器,可以查看程序如何运行或崩溃时的状态. 主要功能: 启动程序,可以按照自定义的要求运行程序. 可让被调试的程序在你所指定的断点处停住. 当程序被停住时,可以检查此时 ...
- 利用sed将xml报文转换为分隔符形式报文
原始xml文本如下 <?xml version="1.0" encoding="utf-8"?> <Message> <Heade ...
- 局部敏感哈希LSH(Locality-Sensitive Hashing)——海量数据相似性查找技术
一. 前言 最近在工作中需要对海量数据进行相似性查找,即对微博全量用户进行关注相似度计算,计算得到每个用户关注相似度最高的TOP-N个用户,首先想到的是利用简单的协同过滤,先定义相似性度量(c ...
- Pandas处理日常EXCEL表格的便捷操作
第一次写博客,写的可能有点乱,有问题可以一起探讨.格式可能控制也不是太好. 1.日常的数据集大多带有中文格式,例如“公务员招聘岗位汇总.xls”.我们使用pandas的read_csv()函数读取可能 ...
- 像智能手机一样管理云端应用:阿里云联合微软全球首发开放应用模型(OAM)
2019 年 10 月 17 日上午 9 点 15 分,阿里巴巴合伙人.阿里云智能基础产品事业部总经理蒋江伟在 QCon 上海<基于云架构的研发模式演进>主题演讲中,正式宣布: " ...