Applies To
What happened?
Steps to reproduce:
Create a .env file with the following content:
Create a .ipynb file with the following cell:
import os
print(f'foo == bar: {os.environ.get("foo") == "bar"}') # expected: True, actual: True
print(f'hello == world: {os.environ.get("hello") == "world"}') # expected True, actual: False
print(f'hello == "world": {os.environ.get("hello") == "\"world\""}') # expected False, actual: True
Expected:
os.environ.get('hello') returns 'world'
Actual:
os.environ.get('hello') returns '"world"'
The same problem occurs with single quotes. Note that python-dotenv properly handles quoted values.
VS Code Version
1.104.2
Jupyter Extension Version
v2025.8.0
Jupyter logs
Coding Language and Runtime Version
Python v3.12.3
Language Extension Version (if applicable)
No response
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Local
Applies To
What happened?
Steps to reproduce:
Create a
.envfile with the following content:Create a
.ipynbfile with the following cell:Expected:
os.environ.get('hello')returns'world'Actual:
os.environ.get('hello')returns'"world"'The same problem occurs with single quotes. Note that python-dotenv properly handles quoted values.
VS Code Version
1.104.2
Jupyter Extension Version
v2025.8.0
Jupyter logs
Coding Language and Runtime Version
Python v3.12.3
Language Extension Version (if applicable)
No response
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Local