Skip to content

Environment Variables are not Accessible when running R code in sandbox #665

Open
e2b-dev/code-interpreter
#108
@Thimows

Description

@Thimows

Describe the bug
When setting environment variables like:

import { Sandbox } from '@e2b/code-interpreter'

const sandbox = await Sandbox.create({
  env: { 
    TEST_VAR: '123', 
  }, 
})

The envs do not seem to be accessible when running R code in the sandbox:

Sys.getenv("TEST_VAR")

Output:

[1] ""

While it works with Python:

import os
print(os.getenv('TEST_VAR'))

Output:

123

To Reproduce
Steps to reproduce the behavior:

  1. Create a sandbox with environment variables
  2. Run R code in the sandbox to try and print an environment variable
  3. The variable appears empty
  • "e2b": "^1.2.0-beta.0",
  • "@e2b/code-interpreter": "^1.2.0-beta.1"

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions