在对FastAPI安装验证时出现以下报错

ImportError: cannot import name 'FastAPI' from partially initialized module

查询资料后并非是循环调用导致的冲突,由于FastAPI是早先装过的库,考虑可能是版本问题卸载重新安装之后,出现以下警告

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
xinference 0.14.3 requires fastapi==0.110.3, but you have fastapi 0.112.2 which is incompatible.
(Python的依赖解析器没有考虑到已安装的需求库,导致了依赖冲突,而Xinference的依赖库是0.110.3版本的fastapi)

解决:卸载fastapi之后,安装指定版本(0.110.3)的fastpai库

问题解决。

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐