原文:python3.x運行的坑:AttributeError: 'str' object has no attribute 'decode'

Python .x和Python .X版本有一些區別,我遇到了兩個問題如下: a.第一個報:mysqlclient . 版本不對: 解決辦法:注釋掉這行即可 b.第二個報:字符集的問題: 報錯如下:File C: Users Administrator PycharmProjects untitled venv lib site packages django db backends mysql ...

2019-08-30 10:31 0 451 推薦指數:

查看詳情

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

python3下列代碼會報上邊的錯 print("Response:", resp.text.decode('unicode_escape'))解決辦法:print("Response:", resp.text.encode('utf-8').decode('unicode_escape ...

Mon Aug 10 18:23:00 CST 2020 0 888
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM