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人點贊
 
相關文章
相關標籤/搜索