出现上面的问题找到:Python37\lib\site-packages\django\db\backends\mysql\operations.py"。
打开修改里面: query = query.decode(errors='replace') 改成query = query.encode(errors='replace')就可以了。
vim /usr/local/python3/lib/python3.6/site-packages/django/db/backends/mysql/operations.py
query = query.decode(errors='replace')修改为:query = query.encode(errors='replace')
相关文章
- 10-30【E-21】AttributeError: 'float' object has no attribute 'decode'
- 10-30django报错query = query.decode(errors=‘replace‘) AttributeError: ‘str‘ object has no attribute ‘decode
- 10-30django-AttributeError: 'str' object has no attribute 'decode'
- 10-30AttributeError: 'str' object has no attribute 'decode'
- 10-30AttributeError: 'str' object has no attribute 'decode'
- 10-30Django报错:AttributeError: 'str' object has no attribute 'decode'
- 10-30Django报错:AttributeError: 'str' object has no attribute 'decode'
- 10-30AttributeError: 'str' object has no attribute 'decode'
- 10-30pyecharts import Bar后找不到Bar,或报错AttributeError: 'str' object has no attribute 'get
- 10-30tenosrrt错误AttributeError: 'NoneType' object has no attribute 'serialize, 解决方法:更换版本