Python 3. X: attributeerror: ‘STR’ object has no attribute ‘decode’
1. There are some differences between Python 3.X and python 2.X. I encountered two problems as follows:
a. First report: mysqlclient version 1.3 is wrong:
Solution: comment out the line
b. Second, the problem of character set
The error is as follows: file “C:// users/administrator/pcharmprojects/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’
Solution: Comment out here because the character set is not supported
Similar Posts:
- [Solved] python3.7+django2.2 Error: AttributeError: ‘str’ object has no attribute ‘decode’
- [Solved] Python Error: Attributeerror: ‘STR’ object has no attribute ‘decode’
- [Solved] Djiango Create Migrations Error: query = query.decode(errors=’replace’) AttributeError: ‘str’ object has no attribute ‘decode’
- Django: How to Solve Using Pymysql Error
- Python AttributeError: ‘unicode’ object has no attribute ‘tzinfo’
- attributeerror: ‘str’ object has no attribute ‘decode’
- [Solved] Unicode decode error in the background when the robot framework is running
- [Solved] Pyinstaller package Error: AttributeError: ‘str’ object has no attribute ‘decode’
- ImportError: No module named pytz
- [Solved] Python Error: UnicodeDecodeError: ‘gb2312’ codec can’t decode byte 0xa4 in position… : illegal multibyte sequence