geekan / MetaGPT

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
https://deepwisdom.ai/
MIT License
45.71k stars 5.43k forks source link

[IPKernelApp] WARNING | Parent appears to have exited, shutting down #908

Closed mabin2016 closed 1 month ago

mabin2016 commented 9 months ago

Bug description

Version: v0.7-release System: windows10 config2.yaml

llm:
  api_type: "openai"
  api_key: "your-api-key"
  model: "gpt-3.5-turbo-1106"
  base_url: "your-base-url"

desc: When I run the example of .\examples\mi\data_visualization.py, itoccur error like '[IPKernelApp] WARNING | Parent appears to have exited, shutting down.'. The full error is

PS E:\dev> & D:/software/anaconda3/envs/test/python.exe e:/dev/MetaGPT/examples/mi/data_visualization.py
2024-02-20 11:12:55.502 | INFO     | metagpt.const:get_metagpt_package_root:29 - Package root set to e:\dev\metagpt
Traceback (most recent call last):
  File "e:\dev\MetaGPT\examples\mi\data_visualization.py", line 3, in <module>
    from metagpt.roles.mi.interpreter import Interpreter
  File "e:\dev\metagpt\metagpt\roles\__init__.py", line 9, in <module>
    from metagpt.roles.role import Role
  File "e:\dev\metagpt\metagpt\roles\role.py", line 30, in <module>
    from metagpt.actions import Action, ActionOutput
  File "e:\dev\metagpt\metagpt\actions\__init__.py", line 10, in <module>
    from metagpt.actions.action import Action
  File "e:\dev\metagpt\metagpt\actions\action.py", line 15, in <module>
    from metagpt.actions.action_node import ActionNode
  File "e:\dev\metagpt\metagpt\actions\action_node.py", line 20, in <module>
    from metagpt.llm import BaseLLM
  File "e:\dev\metagpt\metagpt\llm.py", line 11, in <module>
    from metagpt.context import Context
  File "e:\dev\metagpt\metagpt\context.py", line 14, in <module>
    from metagpt.config2 import Config
  File "e:\dev\metagpt\metagpt\config2.py", line 137, in <module>
    config = Config.default()
  File "e:\dev\metagpt\metagpt\config2.py", line 101, in default
    return Config(**final)
  File "D:\software\anaconda3\envs\test\lib\site-packages\pydantic\main.py", line 164, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Config
llm.api_key
  Value error, Please set your API key in config2.yaml [type=value_error, input_value='YOUR_API_KEY', input_type=str]
    For further information visit https://errors.pydantic.dev/2.5/v/value_error
PS E:\dev> & D:/software/anaconda3/envs/test/python.exe e:/dev/MetaGPT/examples/mi/data_visualization.py
2024-02-20 11:13:31.995 | INFO     | metagpt.const:get_metagpt_package_root:29 - Package root set to e:\dev\metagpt
```json
[
    {
        "task_id": "1",
        "dependent_task_ids": [],
        "instruction": "Load the Iris dataset using sklearn",
    },
    {
        "task_id": "2",
        "dependent_task_ids": ["1"],
        "instruction": "Perform data analysis on the loaded Iris dataset",
    },
    {
        "task_id": "3",
        "dependent_task_ids": ["2"],
        "instruction": "Create a plot to visualize the analysis results",
    }
]

2024-02-20 11:13:48.631 | INFO | metagpt.utils.cost_manager:update_cost:52 - Total running cost: $0.000 | Max budget: $10.000 | Current cost: $0.000, prompt_tokens: 234, completion_tokens: 107 2024-02-20 11:13:48.635 | WARNING | metagpt.strategy.planner:update_plan:63 - The generated plan is not valid with error: Expecting property name enclosed in double quotes: line 6 column 5 (char 132), try regenerating, remember to generate either the whole plan or the single changed task only

[
    {
        "task_id": "1",
        "dependent_task_ids": [],
        "instruction": "Load the Iris dataset using sklearn"
    },
    {
        "task_id": "2",
        "dependent_task_ids": ["1"],
        "instruction": "Perform data analysis on the loaded Iris dataset"
    },
    {
        "task_id": "3",
        "dependent_task_ids": ["2"],
        "instruction": "Create a plot to visualize the analysis results"
    }
]

2024-02-20 11:13:52.173 | INFO | metagpt.utils.cost_manager:update_cost:52 - Total running cost: $0.001 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 388, completion_tokens: 107 2024-02-20 11:13:52.176 | INFO | metagpt.roles.role:_plan_and_act:494 - ready to take on task task_id='1' dependent_task_ids=[] instruction='Load the Iris dataset using sklearn' task_type='' code='' result='' is_success=False is_finished=False 2024-02-20 11:13:52.179 | INFO | metagpt.roles.mi.interpreter:_write_code:79 - ready to WriteCodeWithoutTools 2024-02-20 11:13:54.853 | INFO | metagpt.utils.cost_manager:update_cost:52 - Total running cost: $0.001 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 504, completion_tokens: 23 1 from sklearn.datasets import load_iris D:\software\anaconda3\envs\test\lib\site-packages\zmq_future.py:693: RuntimeWarning: Proactor event loop does not implement add_reader family of methods required for zmq. Registering an additional selector thread for add_reader support via tornado. Use asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy()) to avoid this warning. self._get_loop()

2024-02-20 11:13:58.485 | INFO | metagpt.roles.role:_plan_and_act:494 - ready to take on task task_id='2' dependent_task_ids=['1'] instruction='Perform data analysis on the loaded Iris dataset' task_type='' code='' result='' is_success=False is_finished=False 2024-02-20 11:13:58.488 | INFO | metagpt.roles.mi.interpreter:_write_code:79 - ready to WriteCodeWithoutTools 2024-02-20 11:14:01.928 | INFO | metagpt.utils.cost_manager:update_cost:52 - Total running cost: $0.001 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 515, completion_tokens: 28 1 from sklearn.datasets import load_iris 2 import pandas as pd

2024-02-20 11:14:02.453 | INFO | metagpt.roles.role:_plan_and_act:494 - ready to take on task task_id='3' dependent_task_ids=['2'] instruction='Create a plot to visualize the analysis results' task_type='' code='' result='' is_success=False is_finished=False 2024-02-20 11:14:02.458 | INFO | metagpt.roles.mi.interpreter:_write_code:79 - ready to WriteCodeWithoutTools 2024-02-20 11:14:05.121 | INFO | metagpt.utils.cost_manager:update_cost:52 - Total running cost: $0.001 | Max budget: $10.000 | Current cost: $0.001, prompt_tokens: 528, completion_tokens: 28 1 from sklearn.datasets import load_iris 2 import pandas as pd

[IPKernelApp] WARNING | Parent appears to have exited, shutting down.

orange-crow commented 9 months ago

Thank you for filing this issue, Looks like the Jupyter process was terminated(MG Interpreter use Jupyter as python Executor), But the log seems not complete, I can't analyze the specific reasons. The code was terminated for many reasons, such as, killed by the computer system due to computer system resource issues

geekan commented 8 months ago

@garylin2099 Can you look at this question together? I suspect it is caused by too fast execution (without proper waiting). There are multiple issues with this problem in gpt-3.5-turbo.

better629 commented 1 month ago

Due to the lack of updates or replies by the user for a long time, we will close it. Please reopen it if necessary.