You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用manage-fastapi执行fastapi run时遇FileNotFoundError错误求助

问题

使用manage-fastapi创建FastAPI项目后,执行fastapi run命令时触发如下错误:

1491, in _execute_child     
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
解决方案
  • 改用Python模块方式启动:替换命令为python -m fastapi run(Windows环境可尝试py -m fastapi run),绕开路径查找问题。
  • 确认虚拟环境激活状态:如果项目使用了虚拟环境,先激活对应环境再执行启动命令。
  • 重装相关依赖:卸载并重新安装包,执行以下命令:
    pip uninstall -y manage-fastapi fastapi uvicorn
    pip install manage-fastapi fastapi uvicorn
    
  • 检查项目配置文件:查看项目内的manage-fastapi配置文件(如pyproject.toml),确认启动配置里的可执行文件路径无拼写错误。

内容的提问来源于stack exchange,提问作者code_10

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 02:25:53