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

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

Open
shadk9 opened this issue Oct 9, 2024 · 3 comments
Open

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

shadk9 opened this issue Oct 9, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@shadk9
Copy link

shadk9 commented Oct 9, 2024

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):

  • OS: Windows 11
@shadk9 shadk9 added the bug Something isn't working label Oct 9, 2024
Copy link

linear bot commented Oct 9, 2024

@shadk9
Copy link
Author

shadk9 commented Oct 9, 2024

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

@ValentaTomas
Copy link
Member

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.

@ValentaTomas ValentaTomas self-assigned this Oct 19, 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
Projects
None yet
Development

No branches or pull requests

2 participants