e2b-dev / E2B

Secure open source cloud runtime for AI apps & AI agents
https://e2b.dev/docs
Apache License 2.0
7.07k stars 464 forks source link

ImportError: cannot import name 'EnvVars' from 'e2b' #456

Open shadk9 opened 1 month ago

shadk9 commented 1 month ago

Describe the bug ImportError: cannot import name 'EnvVars' from 'e2b' (C:\Users....venv\Lib\site-packages\e2b__init__.py)

To Reproduce install e2b and e2b_code_interpreter, and use code interpreter as normal. I belive this to be related to some recent update, as I simply migrated one my code from one project to another, and installed e2b fresh, using poetry. The same code is running as normal in my "old" project, and this import error is not present.

Expected behavior To not encounter this ImportError:

Browser console output Console logs from your browser's developer tool console.

Terminal commands & output Traceback (most recent call last): File "C:\Users\main.py", line 5, in from cb import Chatbot File "C:\Users\cb.py", line 10, in from e2b_repl import PythonAstREPLTool_e2b File "C:\Users\e2b_repl.py", line 20, in from e2b_code_interpreter import CodeInterpreter File "C:\Users.venv\Lib\site-packages\e2b_code_interpreter__init__.py", line 3, in from .main import CodeInterpreter, JupyterExtension File "C:\Users.venv\Lib\site-packages\e2b_code_interpreter\main.py", line 12, in from e2b import EnvVars, ProcessMessage, Sandbox ImportError: cannot import name 'EnvVars' from 'e2b'

Desktop (please complete the following information):

linear[bot] commented 1 month ago

E2B-1004 ImportError: cannot import name 'EnvVars' from 'e2b'

shadk9 commented 1 month ago

So, I believe the issue is from version 0.17.2a60 and that version 0.17.1 works fine.

ValentaTomas commented 1 month ago

Hey @shadk9, the 0.17.2a60 was an older Beta version.

We actually released the Beta as 1.0.1 (https://pypi.org/project/e2b-code-interpreter/1.0.1/). The EnvVars type is no longer exported because the env vars can now be just the standard Dict[str, str] type.