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

[Bug]: autogenstudio start failed caused by autogen circular import #3275

Closed
wenngong opened this issue Aug 2, 2024 · 0 comments
Closed
Labels
bug Something isn't working studio Related to AutoGen Studio.

Comments

@wenngong
Copy link
Contributor

wenngong commented Aug 2, 2024

Describe the bug

when try to run start autogenstudio, get a autogen circular import error.

This error is caused by an unused circular import in autogen/coding/base.py:

from ..agentchat.agent import LLMAgent

And in autogen.agentchat.conversable_agent try to import will also import autogen.coding.base CodeExecutor:

from ..coding.base import CodeExecutor

Steps to reproduce

  1. Run following command to start autogenstudio:
autogenstudio ui --port 8081
  1. See error
Traceback (most recent call last):
  File "/usr/local/bin/autogenstudio", line 5, in <module>
    from autogenstudio.cli import run
  File "/usr/local/lib/python3.9/site-packages/autogenstudio/__init__.py", line 1, in <module>
    from .chatmanager import *
  File "/usr/local/lib/python3.9/site-packages/autogenstudio/chatmanager.py", line 11, in <module>
    from .workflowmanager import WorkflowManager
  File "/usr/local/lib/python3.9/site-packages/autogenstudio/workflowmanager.py", line 19, in <module>
    from .utils import (
  File "/usr/local/lib/python3.9/site-packages/autogenstudio/utils/__init__.py", line 1, in <module>
    from .utils import *
  File "/usr/local/lib/python3.9/site-packages/autogenstudio/utils/utils.py", line 13, in <module>
    from autogen.coding import DockerCommandLineCodeExecutor, LocalCommandLineCodeExecutor
  File "/Users/Code/ai/autogen/autogen/coding/__init__.py", line 1, in <module>
    from .base import CodeBlock, CodeExecutor, CodeExtractor, CodeResult
  File "/Users/Code/ai/autogen/autogen/coding/base.py", line 7, in <module>
    from ..agentchat.agent import LLMAgent
  File "/Users/Code/ai/autogen/autogen/agentchat/__init__.py", line 2, in <module>
    from .assistant_agent import AssistantAgent
  File "/Users/Code/ai/autogen/autogen/agentchat/assistant_agent.py", line 5, in <module>
    from .conversable_agent import ConversableAgent
  File "/Users/Code/ai/autogen/autogen/agentchat/conversable_agent.py", line 29, in <module>
    from ..coding.base import CodeExecutor
ImportError: cannot import name 'CodeExecutor' from partially initialized module 'autogen.coding.base' (most likely due to a circular import) (/Users/Code/ai/autogen/autogen/coding/base.py)

Model Used

No response

Expected Behavior

autogenstudio, autogen

Screenshots and logs

No response

Additional Information

No response

@wenngong wenngong added the bug Something isn't working label Aug 2, 2024
@thinkall thinkall added the studio Related to AutoGen Studio. label Aug 5, 2024
@wenngong wenngong closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working studio Related to AutoGen Studio.
Projects
None yet
Development

No branches or pull requests

2 participants