3

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 2

5

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.defaultInterpreterPath setting.

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.defaultInterpreterPath setting 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.

Sign up to request clarification or add additional context in comments.

3 Comments

Weird, i did that through Ctrl + , added the path including .exe but when I do CTRL + Shift + P > Select Python Interpreter it still doesn't list that.
Never mind, I've realized that after doing those steps, it was showing up, but when I clicked enter it would select the first entry and replace it with current (being the edited ne from python.pythonPath)
"python.defaultInterpreterPath": "${command:python.interpreterPath}", I think that might be more dynamic option
2

As Vscode updated, the setting name changed to:

{
    "python.defaultInterpreterPath": "/path/to/your/interpreter/python"
}

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.