from e2b_code_interpreter import CodeInterpretersandbox = CodeInterpreter(template="your-custom-sandbox-name")execution = sandbox.notebook.exec_cell("print('hello')")sandbox.close()# Or you can use `with` which handles closing the sandbox for youwith CodeInterpreter(template="your-custom-sandbox-name") as sandbox: execution = sandbox.notebook.exec_cell("print('hello')")
You can customize number of CPUs and MiB of RAM for your sandbox. To achieve that, specify the --cpu-count and --memory-mb options during the build step:
Jupyter has ability to work with different than Python kernel. It even supports multiple kernels in one notebook. If you want to install another kernels.You can find list of available kernels here. Each has a little bit different installation process, but in general you need to install kernel package and register it in jupyter.