drf 启动报错:AssertionError: `coreapi` must be installed for schema support.

2023-02-18 14:48:49 浏览数 (1)

错误日志(error log):

AssertionError: `coreapi` must be installed for schema support.

解决办法(solution):

代码语言:javascript复制
(joyoo2) yinzhuoqundeMacBook-Pro:joyoo yinzhuoqun$ pip install coreapi
Collecting coreapi
  Downloading coreapi-2.3.3-py2.py3-none-any.whl (25 kB)
Collecting itypes
  Downloading itypes-1.2.0-py2.py3-none-any.whl (4.8 kB)
Requirement already satisfied: requests in /Users/yinzhuoqun/.pyenv/joyoo2/lib/python3.6/site-packages (from coreapi) (2.18.4)
Collecting uritemplate
  Downloading uritemplate-3.0.1-py2.py3-none-any.whl (15 kB)
Collecting coreschema
  Downloading coreschema-0.0.4.tar.gz (10 kB)
Requirement already satisfied: idna<2.7,>=2.5 in /Users/yinzhuoqun/.pyenv/joyoo2/lib/python3.6/site-packages (from requests->coreapi) (2.6)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/yinzhuoqun/.pyenv/joyoo2/lib/python3.6/site-packages (from requests->coreapi) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /Users/yinzhuoqun/.pyenv/joyoo2/lib/python3.6/site-packages (from requests->coreapi) (2017.7.27.1)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /Users/yinzhuoqun/.pyenv/joyoo2/lib/python3.6/site-packages (from requests->coreapi) (1.22)
Collecting jinja2
  Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 454 kB/s 
Collecting MarkupSafe>=0.23
  Using cached MarkupSafe-1.1.1-cp36-cp36m-macosx_10_6_intel.whl (18 kB)
Building wheels for collected packages: coreschema
  Building wheel for coreschema (setup.py) ... done
  Created wheel for coreschema: filename=coreschema-0.0.4-py3-none-any.whl size=15031 sha256=8a1b8c38bd33bd99a024339f52d5caea1d9e3d6890bde61cc3dd28a10d58e986
  Stored in directory: /Users/yinzhuoqun/Library/Caches/pip/wheels/09/1c/f4/e9bdef7dca4b276f7f28a03943f4059466188def81a65b1b44
Successfully built coreschema
Installing collected packages: itypes, uritemplate, MarkupSafe, jinja2, coreschema, coreapi
Successfully installed MarkupSafe-1.1.1 coreapi-2.3.3 coreschema-0.0.4 itypes-1.2.0 jinja2-2.11.2 uritemplate-3.0.1

0 人点赞