-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
When I set e.g. this in a config of my workspace's launch.json:
"pythonPath": "${workspaceFolder}/build/my/own/python",I get an error about the pythonPath being invalid when I try to run it. As soon as I replace it with the full path it works fine, e.g.
"pythonPath": "/home/myusername/my_workspace/build/my/own/python",Note that it works fine with my workspace's settings.json with:
"python.pythonPath": "${workspaceFolder}/build/my/own/python",I happen to use a custom interpreter and I actually have a variety of workspace folders that draw their settings from a same template for my .vscode settings, so it would be great it we could get the variable to work...
I'm using Ubuntu 18.04, with latest vscode (1.46.0). For anyone trying to debug this: I guess it can be easily reproduced by symlinking your system's python into a folder under your workspaceFolder.
Environment data
- VS Code version: 1.46.0
- Extension version (available under the Extensions sidebar): 2020.5.86806
- OS and version: Ubuntu 18.04
- Python version (& distribution if applicable, e.g. Anaconda): 2.7.17 64-bit
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): custom
- Relevant/affected Python packages and their versions: N/A
- Relevant/affected Python-related VS Code extensions and their versions: N/A
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"set to; more info How to update the language server to the latest stable version #3977): N/A? - Value of the
python.languageServersetting: not set
Expected behaviour
I expect that setting this in my launch.json works:
"pythonPath": "${workspaceFolder}/build/my/own/python",Actual behaviour
It doesn't work. But a full path works fine so it seems the variable is not being resolved:
"pythonPath": "/home/myusername/my_workspace/build/my/own/python",Steps to reproduce:
Just make a symlink into your workspace to python:
cd to/you/workspace
ln -s $(which python) Then create a debug config with:
"pythonPath": "${workspaceFolder}/python",Then try to run that debug config