how can I set Enviroment Variables for data science mode of vscode?

Viewed 502

I am using data science mode of vscode.

When vscode runs the jupyter kernel, can I add the desired path to PYTHONPATH of jupyter kernel? In other cases, I used "env" of launch.json, but I can not find the way to set it up in data science mode.

1 Answers

I'm not exactly sure what you're asking. Are you trying to add to PYTHONPATH for some reason or just set it to ensure that the Interactive Python window uses a specific environment?

The simplest interpretation of the question that I can answer is that the jupyter kernel (actually it's the IPython kernel) uses the python environment set as the default for python extension, which you can set with the "Python: Select Interpreter" command. To see which interpreter is being used by the interactive window, execute this cell:

#%%
import sys
print(sys.executable)

Does that help?

Related