python3.x运行的坑:AttributeError: 'str' object has no attribute 'decode'

python3.x运行的坑:AttributeError: 'str' object has no attribute 'decode'

2019.05.22 21:38:45字数124阅读1909

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

 

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

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

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

报错以下:File "C:\Users\Administrator\PycharmProjects\untitled1\venv\lib\site-packages\django\db\backends\mysql\operations.py", line 146, in last_executed_querypython3.x

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

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

报错截图:pdo

 

 
解决办法:注释掉这里,由于字符集不支持的缘由

 

 
 
 
0人点赞
 
相关文章
相关标签/搜索