VSCode "Python: Select interpreter" add a custom path

Viewed 2508

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?

1 Answers

You can add a python.pythonPath setting in the settings.json file of your workspace.

From Manually specify an interpreter:

If VS Code does not automatically locate an interpreter you want to use, you can set the path to it manually in your Workspace Settings settings.json file. With any of the entries that follow, you can just add the line as a sibling to other existing settings.)

For example, in your workspace's .vscode/settings.json:

{
    "python.pythonPath": "/path/to/your/custom/python"
}

I recommend reloading VS Code after setting the pythonPath. If it works, every time you open the workspace, it will automatically use that Python interpreter.

Related