-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
I use asdf-vm to manage various versions of Python binaries. This version manager allows one to define a specific Python version for a specific directory by making use of shims. However, this means that the selection of which Python version to use is dependent on the current working directory. This is where I am having issues with vscode-python.
Reproduction
Assume the VSCode workspace directory to be /home/kevin/dir1/dir2
Assume the following script, located in /tmp/test.sh:
#!/bin/sh
pwd
Select this script as the Python interpreter (Command pallette, > Python: Select Interpreter -> /tmp/test.sh).
Behaviour
Expected
pwd prints /home/kevin/dir1/dir2
Actual
pwd prints /home/kevin
Note: Both cases will generate an error as /tmp/test.sh is not a valid Python interpreter. The JSON error from the Python output found below is thus not related to the actual issue I am experiencing.
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda):
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
- Value of the
python.languageServersetting: Default
Output for Python in the Output panel (ViewβOutput, change the drop-down the upper-right of the Output panel to Python)
> /tmp/test.sh -I ~/.vscode-oss/extensions/ms-python.python-2023.3.10551009/pythonFiles/get_output_via_markers.py ~/.vscode-oss/extensions/ms-python.python-2023.3.10551009/pythonFiles/interpreterInfo.py
[ERROR 2023-1-24 13:24:48.606]: Failed to parse interpreter information for >> /tmp/test.sh -I /home/kevin/.vscode-oss/extensions/ms-python.python-2023.3.10551009/pythonFiles/get_output_via_markers.py /home/kevin/.vscode-oss/extensions/ms-python.python-2023.3.10551009/pythonFiles/interpreterInfo.py << with Error: python /home/kevin/.vscode-oss/extensions/ms-python.python-2023.3.10551009/pythonFiles/interpreterInfo.py returned bad JSON (/home/kevin
) (SyntaxError: Unexpected token / in JSON at position 0)
User Settings
languageServer: "Pylance"
Extension version: 2023.3.10551009
VSCodium version: VSCodium 1.75.1 (c6a9727b801542499d2b59cb7db4224e060fc578, 2023-02-09T22:41:50.017Z)
OS version: Linux x64 6.1.9-200.fc37.x86_64
Modes:
Sandboxed: No