【问题标题】:Problem with uvicorn when I ran FastAPI code运行 FastAPI 代码时 uvicorn 出现问题
【发布时间】:2022-12-21 02:11:16
【问题描述】:

当我为每个 FastAPI 代码运行 uvicorn 时出现此错误:

ModuleNotFoundError: No module named 'h11._receivebuffer'

但是我用pip安装了h11。

谢谢你的帮助。

【问题讨论】:

    标签: fastapi uvicorn


    【解决方案1】:

    【讨论】:

      【解决方案2】:

      答案可能在于您运行uvicorn 的方式。我在尝试时遇到了同样的问题

      uvicorn main:app
      

      但运行 uvicorn 的正确方法通常是

      python -m uvicorn main:app
      

      这至少对我来说有效。

      【讨论】:

        猜你喜欢
        • 2021-04-02
        • 2021-11-07
        • 1970-01-01
        • 2021-04-12
        • 2020-06-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多