Skip to content

Dependency versioning #61

@ndahn

Description

@ndahn

Hello :)

I found that when adding jpl-rosa as a dependency in my project, the versions of langchain it pulled in were slightly outdated, resulting in the error below. Updating langchain fixed this, despite a supposed version mismatch. It may be better to use compatibility versioning (~=) instead of strict versioning (==) for dependencies.

Error from langchain (pydantic was up to date):

Traceback (most recent call last):
  File "/opt/workspace/build/robot_mission_control/robot_mission_control/widgets/widget.py", line 17, in __call__
    instance = super().__call__(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/workspace/build/robot_mission_control/robot_mission_control/widgets/chatbot.py", line 541, in __init__
    llm = ChatOpenAI(
          ^^^^^^^^^^^
  File "/opt/workspace/venv/lib/python3.12/site-packages/langchain_core/load/serializable.py", line 111, in __init__
    super().__init__(*args, **kwargs)
  File "/opt/workspace/venv/lib/python3.12/site-packages/pydantic/main.py", line 253, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/workspace/venv/lib/python3.12/site-packages/pydantic/_internal/_mock_val_ser.py", line 100, in __getattr__
    raise PydanticUserError(self._error_message, code=self._code)
pydantic.errors.PydanticUserError: `ChatOpenAI` is not fully defined; you should define `BaseCache`, then call `ChatOpenAI.model_rebuild()`.

For further information visit https://errors.pydantic.dev/2.11/u/class-not-fully-defined

pip install langchain --upgrade fixed this, my currently installed versions are langchain 0.3.23, langchain-community 0.3.21 and langchain-core 0.3.52.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions