zoukankan      html  css  js  c++  java
  • python3.x运行的坑:AttributeError: 'str' object has no attribute 'decode'

    1、Python3.x和Python2.X版本有一些区别,我遇到了两个问题如下:

    a.第一个报:mysqlclient 1.3版本不对:

    解决办法:注释掉这行即可;

    b.第二个报:字符集的问题:

    报错如下:File "C:UsersAdministratorPycharmProjectsuntitled1venvlibsite-packagesdjangodbackendsmysqloperations.py", line 146, in last_executed_query

        query = query.decode(errors='replace')

    AttributeError: 'str' object has no attribute 'decode'

    报错截图:

     
    解决办法:注释掉这里,因为字符集不支持的原因
     
  • 相关阅读:
    网页轮播图案例
    表单
    表格标签的使用
    HTML5标签2
    HTML标签
    外边距
    h5css产品模块设计
    mouseenter 和mouseover的区别
    动画函数封装
    jQuery 插件
  • 原文地址:https://www.cnblogs.com/wangshicheng/p/11433592.html
Copyright © 2011-2022 走看看