pip3 install uvicorn
报错:
uvloop/loop.c:20:20: 致命错误:Python.h:没有那个文件或目录
#include "Python.h"
^
编译中断。
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qiwhtevf/uvloop/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-nr2y25dq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-qiwhtevf/uvloop/
百度上搜了一圈,没有找到需要的答案,最后安装这个解决了:
代码语言:javascript复制pip3 intall yum install python3-devel
再去执行pip3 install uvicorn
时正常,问题解决。