1、Python3.x和Python2.X版本有一些区别,我遇到了两个问题如下:
a.第一个报:mysqlclient 1.3版本不对:
解决办法:注释掉这行即可;
b.第二个报:字符集的问题:
报错如下: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'
报错截图:
![](http://upload-images.jianshu.io/upload_images/17953771-6ddda31093c2ab3d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/968)
解决办法:注释掉这里,因为字符集不支持的原因
![](http://upload-images.jianshu.io/upload_images/17953771-1030eaa1c73d45de.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000)