langflow-ai / langflow

Langflow is a low-code app builder for RAG and multi-agent AI applications. It’s Python-based and agnostic to any model, API, or database.
http://www.langflow.org
MIT License
34.24k stars 4.13k forks source link

ImportError: cannot import name 'CodeInterpreter' from 'e2b_code_interpreter' #4164

Open phact opened 1 month ago

phact commented 1 month ago
          I think there's an e2b_code_interpreter problem as well in .19. Have you stumbled upon it?
     │                                                                                                                                                           │
                             │ /Users/.../Library/Caches/uv/archive-v0/_cr7vMV6pjW43AbOp9t_q/lib/python3.10/site-packages/langflow/base/astra_assistants/util.py:56 in <module> │
                             │                                                                                                                                                           │
                             │   53 │   │   │   │   tools_and_names[name] = obj                                                                                                          │
                             │   54                                                                                                                                                      │
                             │   55                                                                                                                                                      │
                             │ ❱ 56 tools_from_package(astra_assistants_tools)                                                                                                           │
                             │   57                                                                                                                                                      │
                             │                                                                                                                                                           │
                             │ /Users/.../Library/Caches/uv/archive-v0/_cr7vMV6pjW43AbOp9t_q/lib/python3.10/site-packages/langflow/base/astra_assistants/util.py:46 in          │
                             │ tools_from_package                                                                                                                                        │
                             │                                                                                                                                                           │
                             │   43 │   │   module_name = f"{package_name}.{module_info.name}"                                                                                           │
                             │   44 │   │                                                                                                                                                │
                             │   45 │   │   # Dynamically import the module                                                                                                              │
                             │ ❱ 46 │   │   module = importlib.import_module(module_name)                                                                                                │
                             │   47 │   │                                                                                                                                                │
                             │   48 │   │   # Iterate over all members of the module                                                                                                     │
                             │   49 │   │   for name, obj in inspect.getmembers(module, inspect.isclass):                                                                                │
                             │                                                                                                                                                           │
                             │ /Users/../Lib.rary/Application Support/uv/python/cpython-3.10.14-macos-aarch64-none/lib/python3.10/importlib/__init__.py:126 in import_module    │
                             │                                                                                                                                                           │
                             │   123 │   │   │   if character != '.':                                                                                                                    │
                             │   124 │   │   │   │   break                                                                                                                               │
                             │   125 │   │   │   level += 1                                                                                                                              │
                             │ ❱ 126 │   return _bootstrap._gcd_import(name[level:], package, level)                                                                                     │
                             │   127                                                                                                                                                     │
                             │   128                                                                                                                                                     │
                             │   129 _RELOADING = {}                                                                                                                                     │
                             │ in _gcd_import:1050                                                                                                                                       │
                             │ in _find_and_load:1027                                                                                                                                    │
                             │ in _find_and_load_unlocked:1006                                                                                                                           │
                             │ in _load_unlocked:688                                                                                                                                     │
                             │ in exec_module:883                                                                                                                                        │
                             │ in _call_with_frames_removed:241                                                                                                                          │
                             │                                                                                                                                                           │
                             │ /Users/../Library/Caches/uv/archive-v0/_cr7vMV6pjW43AbOp9t_q/lib/python3.10/site-packages/astra_assistants/tools/e2b_code_interpreter.py:3 in   │
                             │ <module>                                                                                                                                                  │
                             │                                                                                                                                                           │
                             │    1 from e2b import Sandbox                                                                                                                              │
                             │    2                                                                                                                                                      │
                             │ ❱  3 from e2b_code_interpreter import CodeInterpreter                                                                                                     │
                             │    4                                                                                                                                                      │
                             │    5 from astra_assistants.tools.tool_interface import ToolInterface                                                                                      │
                             │    6                                                                                                                                                      │
                             ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
                             ImportError: cannot import name 'CodeInterpreter' from 'e2b_code_interpreter'

Originally posted by @ogabrielluiz in https://github.com/langflow-ai/langflow/pull/4150#pullrequestreview-2370332306

rjavedv commented 2 weeks ago

I am also facing the same issue. │ D:\envs\langflow\Lib\site-packages\astra_assistants\tools\e2b_code_interpreter.py:3 in
│ │ │ 1 from e2b import Sandbox
│ 2 │ │ ❱ 3 from e2b_code_interpreter import CodeInterpreter
│ 4 │ │ 5 from astra_assistants.tools.tool_interface import ToolInterface
│ 6 │ ────────────────────────────────────────────────────────────────────────────╯ ImportError: cannot import name 'CodeInterpreter' from 'e2b_code_interpreter' (D:\envs\langflow\Lib\site-packages\e2b_code_interpreter__init__.py)