python打包exe

                                                  python打包exe

一、安装pyinstaller

          cmd命令安装

     pip install pyinstaller  
  
    如果下载失败建议使用代理

      (1)国内pip源:
               清华:https://pypi.tuna.tsinghua.edu.cn/simple
               阿里云:https://mirrors.aliyun.com/pypi/simple
               中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple
               豆瓣:https://pypi.douban.com/simple
     (2)临时使用
               格式为:pip install -i 国内源网址 模块名
              例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple face_recognition

              pip3 install -i https://pypi.douban.com/simple sqlalchemy

              npm install -i https://pypi.douban.com/simple connect-multiparty

二、python程序打包(不带参数)

          文件命名规范:不支持中文命令的python文件;

     路径:建议路径中不带中文目录;

     命令:pyinstaller -F 文件名(带后缀py)

     #命令语法:pyinstaller -F 文件名(带后缀py)
     #常用参数说明:
     #–icon=图标路径
     #-F 打包成一个exe文件
     #-w 使用窗口,无控制台
     #-c 使用控制台,无窗口
     #-D 创建一个目录,里面包含exe以及其他一些依赖性文件
     #pyinstaller -h 来查看参数
​
     #将cmd的目录切换至(命令:cd 文件路径(注意空格))需要打包的py文件目录下:
     #有命令窗口弹出
     pyinstaller -F start.py  
     #无命令窗口弹出
     pyinstaller -F -w start.py  
     #或者
     pyinstaller -F start.py  --noconsole

三、查看生成文件

 

         build文件可以删掉

         dist路劲下可执行文件

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值