python - 从终端调用时,uvicorn 不工作
问题描述
我尝试通过 pip3 在系统上安装 uvicorn,但我无法从命令行运行它。有关如何解决此问题的任何指示?
Requirement already satisfied: uvicorn in /home/vhawk19/.local/lib/python3.7/site-packages (0.10.8)
Requirement already satisfied: uvloop>=0.14.0; sys_platform != "win32" and sys_platform != "cygwin" and platform_py
thon_implementation != "pypy" in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn) (0.14.0)
Requirement already satisfied: websockets==8.* in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn)
(8.1)
Requirement already satisfied: click==7.* in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn) (7.0
)
Requirement already satisfied: h11==0.8.* in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn) (0.8
.1)
Requirement already satisfied: httptools==0.0.13; sys_platform != "win32" and sys_platform != "cygwin" and platform
_python_implementation != "pypy" in /home/vhawk19/.local/lib/python3.7/site-packages (from uvicorn) (0.0.13)
vhawk19@api-server:~/api-server$ uvicorn
-bash: uvicorn: command not found```
解决方案
您可以直接从 cmd 使用以下命令。该路径适合我的情况,但使用 uvicorn 命令仍然出现错误。
python -m uvicorn
推荐阅读
- python - 重复组的不同分组累积和
- c - 更改字符串中的字母
- javascript - 为什么我的复制变量更改节点js中的原始值变量?
- android - 具有自动跨度计数和带有包装内容的项目宽度的回收站视图
- node.js - NestJS HttpService所有方法API调用在使用拦截器时不起作用
- sql - SQL 检查是否添加了新的商店组,然后相应地标记他们的商店
- reactjs - React: setState 与 spad 运算符似乎直接修改状态
- .net - Swashbuckle.AspNetCore Swagger [5.0.0 | OpenAPI 3.0] 过滤器来设置消费/生产
- c - getchar() != ' ' 和 getchar() = ' '
- ruby-on-rails - 如何分离开发和生产sidekiq工人