原因:Uvicorn在新版本后[>= 0.12]有关,不会自动提供websocket实现。
解决:先卸载已有版本uvicorn:pip uninstall unicorn
重新安装指定版本pip install uvicorn [standard]
即可正常使用。