Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' #116

Open
Liya020 opened this issue Jun 11, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Liya020
Copy link

Liya020 commented Jun 11, 2024

Hi, I am using python 3.12.4. After installing the gpt computer assistant in command, I failed to run it in command, it shows below codes:

C:\Users\90471>computerassistant
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "D:\Program Files\PYTHON\Scripts\computerassistant.exe_main
.py", line 4, in
File "D:\Program Files\PYTHON\Lib\site-packages\gpt_computer_assistant_init
.py", line 5, in
from .tooler import Tool
File "D:\Program Files\PYTHON\Lib\site-packages\gpt_computer_assistant\tooler.py", line 1, in
from langchain.tools import tool
File "D:\Program Files\PYTHON\Lib\site-packages\langchain\tools_init_.py", line 23, in
from langchain_core.tools import BaseTool, StructuredTool, Tool, tool
File "D:\Program Files\PYTHON\Lib\site-packages\langchain_core\tools.py", line 34, in
from langchain_core.callbacks import (
File "D:\Program Files\PYTHON\Lib\site-packages\langchain_core\callbacks_init_.py", line 22, in
from langchain_core.callbacks.manager import (
File "D:\Program Files\PYTHON\Lib\site-packages\langchain_core\callbacks\manager.py", line 29, in
from langsmith.run_helpers import get_run_tree_context
File "D:\Program Files\PYTHON\Lib\site-packages\langsmith\run_helpers.py", line 40, in
from langsmith import client as ls_client
File "D:\Program Files\PYTHON\Lib\site-packages\langsmith\client.py", line 52, in
from langsmith import env as ls_env
File "D:\Program Files\PYTHON\Lib\site-packages\langsmith\env_init_.py", line 3, in
from langsmith.env.runtime_env import (
File "D:\Program Files\PYTHON\Lib\site-packages\langsmith\env_runtime_env.py", line 10, in
from langsmith.utils import get_docker_compose_command
File "D:\Program Files\PYTHON\Lib\site-packages\langsmith\utils.py", line 31, in
from langsmith import schemas as ls_schemas
File "D:\Program Files\PYTHON\Lib\site-packages\langsmith\schemas.py", line 69, in
class Example(ExampleBase):
File "D:\Program Files\PYTHON\Lib\site-packages\pydantic\v1\main.py", line 286, in new
cls.try_update_forward_refs()
File "D:\Program Files\PYTHON\Lib\site-packages\pydantic\v1\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))

File "D:\Program Files\PYTHON\Lib\site-packages\pydantic\v1\typing.py", line 554, in update_model_forward_refs
update_field_forward_refs(f, globalns=globalns, localns=localns)
File "D:\Program Files\PYTHON\Lib\site-packages\pydantic\v1\typing.py", line 520, in update_field_forward_refs
field.type
= evaluate_forwardref(field.type_, globalns, localns or None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\PYTHON\Lib\site-packages\pydantic\v1\typing.py", line 66, in evaluate_forwardref
return cast(Any, type_)._evaluate(globalns, localns, set())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

I'm not good at coding. Can anyone help? Thanks.

@Abhinavcode13
Copy link
Contributor

pip3 install gpt-computer-assistant

Did you run the above command prior to running computerassistant ?

@Liya020
Copy link
Author

Liya020 commented Jun 11, 2024

pip3 install gpt-computer-assistant

Did you run the above command prior to running computerassistant ?

Yes, I did. It downloaded a lot of files, and looks like the installation succeeded. Then I try to run it and failed.

@Mideky-hub
Copy link
Contributor

What if you :

  • Go to the root directory
  • type in the cmd "pip3 install -r requirements.txt"

@erquier
Copy link

erquier commented Jun 11, 2024

Im having the same issue I even tryed to run the: "pip3 install -r requirements.txt"

@staneychan
Copy link

I have the same problem with python 3.12.4
And it works fine after replaced with python 3.12.3

@Mideky-hub
Copy link
Contributor

@erquier Try then reverting the Python version as @staneychan and if this still doesn't work :

  • pipx install cookiecutter
  • pipx runpip cookicutter install -r requirements.txt

@mustafadakhel
Copy link

I'm facing the same issue, i was using python 3.12.4 and downgrading to 3.12.3 fixed it for me

@onuratakan
Copy link
Member

I have the same problem with python 3.12.4 And it works fine after replaced with python 3.12.3
I'm facing the same issue, i was using python 3.12.4 and downgrading to 3.12.3 fixed it for me

Ouu its so interesting, ı should put an information about it. And working for fixing. Thank you so much.

@onuratakan onuratakan self-assigned this Jun 14, 2024
@onuratakan onuratakan added the bug Something isn't working label Jun 14, 2024
@Jerry-Terrasse
Copy link

Update pydantic to 2.7.4 will solve the problem. langchain-ai/langchain#22692 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants