I'm trying to run a python executable that is a plugin to an application (Unreal Engine). When I do CTRL + ALT + P and do select python interpreter it only shows me the system installed python interpreter and the virtual envs. How can I add a searchpath?
2 Answers
You can add a python.defaultInterpreterPath setting in the settings.json file of your workspace.
From Manually specify an interpreter:
If VS Code doesn't automatically locate an interpreter you want to use, you can browse for the interpreter on your file system or provide the path to it manually.
If you want to manually specify a default interpreter that will be used when you first open your workspace, you can create or modify an entry for the
python.defaultInterpreterPathsetting.
For example, in your workspace's .vscode/settings.json:
{
"python.defaultInterpreterPath": "/path/to/your/custom/python"
}
Make sure to reload VS Code after setting the defaultInterpreterPath. If it works, every time you open the workspace, it will automatically use that Python interpreter.
Note that:
Changes to the
python.defaultInterpreterPathsetting are not picked up after an interpreter has already been selected for a workspace; any changes to the setting will be ignored once an initial interpreter is selected for the workspace.
3 Comments
Ctrl + , added the path including .exe but when I do CTRL + Shift + P > Select Python Interpreter it still doesn't list that."python.defaultInterpreterPath": "${command:python.interpreterPath}", I think that might be more dynamic option