Hang python3.x run: AttributeError: 'str' object has no attribute 'decode'

1, Python3.x and Python2.X versions have some differences, I encountered two problems as follows:

 

a first report:. mysqlclient 1.3 version does not:

Solution: comment out this line can be;

b Second report: Character Set:

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

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

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

Screenshot error:

 

 
Solution: Comment out here, because of the character set that is not supported

 

 

Guess you like

Origin www.cnblogs.com/wangshicheng/p/11433592.html