MLSysOps / MLE-agent

MLE-Agent is designed to be a pair coding agent for machine learning engineers and researchers. Support OpenAI and Ollama.
MIT License
17 stars 1 forks source link

[bug] Error When Running python cli.py Due to Name Conflict with types Folder #38

Closed rucnyz closed 1 month ago

rucnyz commented 1 month ago

Software execution information

MLE-agent version: 0.0.1 System OS version:

Problem description

I encountered an issue when trying to run the command python cli.py. The problem arises because there is a types folder in the project directory, which conflicts with Python's built-in types module. This conflict results in the following error:

Traceback (most recent call last):
  File "/mnt/c/Users/yuzhn/PycharmProjects/MLE-agent/agent/cli.py", line 3, in <module>
    import click
  File "/home/nieyuzhou/miniconda3/lib/python3.10/site-packages/click/__init__.py", line 7, in <module>
    from .core import Argument as Argument
  File "/home/nieyuzhou/miniconda3/lib/python3.10/site-packages/click/core.py", line 1, in <module>
    import enum
  File "/home/nieyuzhou/miniconda3/lib/python3.10/enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
  File "/mnt/c/Users/yuzhn/PycharmProjects/MLE-agent/agent/types/__init__.py", line 1, in <module>
    from .step import *
  File "/mnt/c/Users/yuzhn/PycharmProjects/MLE-agent/agent/types/step.py", line 1, in <module>
    from typing import List, Optional
  File "/home/nieyuzhou/miniconda3/lib/python3.10/typing.py", line 25, in <module>
    import contextlib
  File "/home/nieyuzhou/miniconda3/lib/python3.10/contextlib.py", line 6, in <module>
    from functools import wraps
  File "/home/nieyuzhou/miniconda3/lib/python3.10/functools.py", line 22, in <module>
    from types import GenericAlias
ImportError: cannot import name 'GenericAlias' from partially initialized module 'types' (most likely due to a circular import)

Steps to reproduce the problem

cd agent
python cli.py

Expected behavior

Other information

To resolve this issue, I suggest renaming the types folder to something else to avoid this naming conflict.

HuaizhengZhang commented 1 month ago

have you install and try mle new

rucnyz commented 1 month ago

have you install and try mle new

This works for me. This issue does not affect actual usage by users; it was only encountered when trying the python cli.py for debugging purposes during development.

huangyz0918 commented 1 month ago

cli.py is not a script to run directly