AttributeError: 'str' object has no attribute 'decode'解码错误,str不能decode

pyinstaller abc.py # 要打包的top代码
    -F         # 只生成单个的exe文件, 缺点是运行exe时要先解压.
    -w         # 不生成命令行窗口.
    --debug    # 生成带debug信息的exe文件.
    --clean    # 运行前清理编译的临时文件;
    --icon     # 工具的top图标文件
    --distpath # 输出的exe存放的目录
    --workpath # 编译的临时文件存放的目录
    --hidden-import # 隐含import的模块, 比如自定义/第三方的import模块等
    --key      # 加密密钥

我是加了--key参数

pyinstaller --key 0123456789 –F [other options]

执行,报错

可以打开此路径

这样改,

或者不想处理

str = "xiaosheng"

第一种      b"xiaosheng"

第二种     bytes(‘xiaosheng’, encoding="utf-8")   #  可以省略,默认utf-8

第三种    ("xiaosheng").encode("utf-8")

分类: python

站点统计

  • 文章总数:309 篇
  • 分类总数:19 个
  • 标签总数:191 个
  • 运行天数:1009 天
  • 访问总数:129483 人次

浙公网安备33011302000604

辽ICP备20003309号