代码之家  ›  专栏  ›  技术社区  ›  Chaldovich Centa

如何解决FastApi和pydantic不匹配的问题?你的pydantic 2.10.6不兼容

  •  1
  • Chaldovich Centa  · 技术社区  · 5 月前

    我正在尝试安装jobspy pip install -U python-jobspy

    我陷入了依赖性不断失败的循环。

         Successfully uninstalled pydantic-1.10.21
    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.
    fastapi 0.70.0 requires pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2, but you have pydantic 2.10.6 which is incompatible.
    Successfully installed pydantic-2.10.6
    

    解决方案是什么? pip不起作用,可能是venv。

    我想要 jobspy.

    1 回复  |  直到 5 月前
        1
  •  1
  •   jsbueno    5 月前

    这个安装对我来说很有效,从一个干净的Python 3.12 venv开始。

    之后 pip install python-jobspy fastapi ,我最终得到了

    fastapi==0.115.7
    pydantic==2.10.6
    python-jobspy==1.1.76
    

    (包括numpy和pandas在内的这些软件包)