pyinstaller打包python程序

1.pyinstaller安装

安装命令:

#升级pip版本
>>> pip install -U pip
#安装pyinstaller
>>> pip install pyinstaller

2.pyinstaller使用

1.选项参数

选项 描述
-h 显示帮助信息
-v 显示版本号
–distpath 指定打包后的程序存放目录,默认存放在当前目录下的dist目录
–workpath 为输出的所有临时文件指定存放目录
-c 显示命令行窗口
-w 不显示命令行窗口
-D 生成结果是一个包含exe程序的目录,所有第三方依赖库和其他资源和exe程序位于同一目录下
-F 生成结果是一个exe程序,所有第三方依赖库和其他资源都被打包进该exe程序中
-i 为生成的程序指定一个icon图标
-n 指定生成的.exe和.spec文件名

2.举例说明

在指定目录下新建一个code.py文件,执行如下命令

# 直接生成到默认路径中
pyinstaller -F C:\Users\86183\PycharmProjects\pythonProject2\网络爬虫和js逆向\04_接单\万方数据抓取\1.py
# 生成到指定路径
pyinstaller -F -w C:\Users\86183\PycharmProjects\pythonProject2\网络爬虫和js逆向\04_接单\万方数据抓取\1.py --distpath C:\Users\86183\Desktop -n code

下面是示例图:

pyinstaller打包python程序的更多相关文章

  1. PyInstaller 打包 python程序成exe

    pychaim下PyInstaller 打包 python程序 主题是使用PyInstaller 打包python时遇到一些问题以及解决方案,其中将要打包的程序是用tensorflow做的LSTM算法 ...

  2. “failed to excute script xxx” PyInstaller 打包python程序为exe文件过程错误

    在使用PyInstaller打包python程序,打包命令为: pyinstaller -F -w -i manage.ico yourpyfile.py 顺便说一下几个参数的作用 -F:是直接生成单 ...

  3. 【Python开发】PyInstaller打包Python程序

    PyInstaller是一个能将Python程序转换成单个可执行文件的程序, 操作系统支持Windows, Linux, Mac OS X, Solaris和AIX.并且很多包都支持开箱即用,不依赖环 ...

  4. 【Python】 如何用pyinstaller打包python程序成exe

    [pyinstaller] pyinstaller在他们的官方网站上下载:http://www.pyinstaller.org/ 下载完pyinstaller之后还要安装一个支持包pywin32. 这 ...

  5. 用pyinstaller打包python程序、打包pyqt程序

    将.py脚本拷贝到一个文件夹中: 然后shift+右键,打开Powershell窗口: -F:设置打包为一个.exe文件.(缺点打开速度慢,不加-F则不打包为一个.exe,优点简洁方便) -w:设置不 ...

  6. 使用pyinstaller 打包python程序

    1.打开PyCharm的Terminal,使用命令pip install pyinstaller安装pyinstaller 2.打包命令:pyinstaller --console --onefile ...

  7. 使用PyInstaller打包Python程序

    本文转载自: http://www.pycoding.com/2015/04/23/pyinstaller.html

  8. 用pyinstaller打包python程序,解决打包时的错误:Cannot find existing PyQt5 plugin directories

    解决方法就是用everything搜索PyQt5,找到 /Library/plugins路径下的PyQt5文件夹,将里面的dll动态库pyqt5qmlplugin.dll复制出来 按照错误提示的路径, ...

  9. 使用 py2exe 打包 Python 程序

    上回在<使用 PyInstaller 打包 Python 程序>中,我们介绍了使用 PyInstaller 对 Python 程序进行打包,今天带大家认识一个新的工具:py2exe. 接下 ...

  10. PyInstaller打包python脚本的一些心得

    PyInstaller打包python脚本的一些心得 因为在公司经常要帮同事做一个从excel表格中提取出需要的内容的重复工作,比较繁琐还容易出错:于是就想着要写个程序,但是同事又不可能在电脑上也装上 ...

随机推荐

  1. Sql Server新建一个只读权限的用户

    1,新建只能访问某一个表的只读用户. --添加只允许访问指定表的用户: exec sp_addlogin '用户名','密码','默认数据库名' --添加到数据库 exec sp_grantdbacc ...

  2. PHP实现斐波那契数列(递归 + 非递归)实现

    非递归写法:function fbnq($n){ //传入数列中数字的个数    if($n <= 0){        return 0;    }    $array[1] = $array ...

  3. Stram流 - 随笔

    函数式编程 注重函数 - 关注对数据进行了什么操作 流 中间操作 去重 authors.stream() .distinct() ; 查询指定匹配 .filter(new Predicate<A ...

  4. 【PostgreSql】more than one owned sequence found

    do --check seq not in sync $$ declare _r record; _i bigint; _m bigint; begin for _r in ( Select DIST ...

  5. This will upgrade your R installation.

    sudo add-apt-repository ppa:marutter/rrutter sudo apt update sudo apt full-upgrade

  6. webpack 3/4踩坑,我太难了,从安装、卸载、到使用,各相应的版本号,sass-loader报错-版本的原因,webpack -v 不识别,没卸载干净

     -先说卸载: wabpack@4对应的每个插件的版本号都在最后 1 全局安装的话,npm uninstall webpack -g 有时候并不能卸载干净, 2 webpack -v 可判断是否安装成 ...

  7. 通过网页或者移动设备链接跳转qq(tim)添加好友(群)

    首先需要去qq群官方,然后点记加群组件,然后选择群,复制对应的代码即可 登录到QQ群官网 点击加群组件 选择群,选择网页还是移动设备 复制代码 示例: <html> <head> ...

  8. Tensorflow learning notebook

    How does tensorflow work 原著blog https://jacobbuckman.com/#posts

  9. learning rate,exponential decay

    (96条消息) Python函数:学习率衰减 tf.train.exponential_decay()_萌萌哒huo的博客-CSDN博客_python 衰减函数 ln即学习率(learning rat ...

  10. Spring源码分析之注册BeanDefinition

    测试代码 public class ContextApplication { public static void main(String[] args) { ClassPathXmlApplicat ...