启动后端服务后,程序会检测没有安装的包,根据提示进行安装,一般是 pip install +报错包名,常见的报错信息 和比较特殊的处理如下
(1)安装django-suite:
pip install https://github.com/darklow/django-suit/tarball/v2
(2)安装crypto pip install pycrypto
(3)提示: error: command 'cl.exe' failed: No such file or directory
使用这个:pip3 install pycryptodome OK了
(4)报错?: (corsheaders.E013) Origin '*' in CORS_ORIGIN_WHITELIST is missing scheme or netloc
在setting中注释掉 CORS_ORIGIN_WHITELIST = ('*') 即可
(5)pip install django-rest-swagger
(6)pip install djangorestframework
(7)本地安装报错:django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
D:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Lib\site-packages\django\db\backends\mysql\base.py 中注释掉 35,36行
(8)ModuleNotFoundError: No module named 'crontab'
D:\03 code\automation_platform\automation_platform\automation_platform> pip install django-crontab
或者django-crontab 不对就是 python-crontab
(9)pip install pycrypto报错
参照: https://my.oschina.net/mengyoufengyu/blog/1524422 使用方法1
(10)AttributeError: 'str' object has no attribute 'decode'
https://blog.csdn.net/qq_41630218/article/details/89631835
(11)python3安装docx模块出现Import Error: No module named 'exceptions'
参考:https://www.cnblogs.com/chaihy/p/10256513.html