forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
area-editor-*User-facing catch-allUser-facing catch-allbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
Environment data
- VS Code version: 1.55.2
- Extension version (available under the Extensions sidebar): v2021.3.680753044
- OS and version: archlinux 5.11.13
- Python version (& distribution if applicable, e.g. Anaconda): pypy3 (based on Python 3.7.10, PyPy 7.3.4)
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions: N/A
- Relevant/affected Python-related VS Code extensions and their versions: N/A
- Value of the
python.languageServersetting: jedi
Expected behaviour
vscode-python can recognize the pypy3 as a valid interpreter.
Actual behaviour
It reports "The Python path in your debug configuration is invalid".
The status bar also indicates "select python interpreter" (even if I already specified one in settings.json).
Steps to reproduce:
- Install pypy3 (i.e.
pacman -S pypy3in archlinux) - Select pypy3 as the python interpreter
Logs
I already triaged the problem to be
cd ${HOME}/.vscode/extensions/ms-python.python-2021.3.680753044/pythonFiles
pypy3 pyvsc-run-isolated.py interpreterInfo.py
# has the error ModuleNotFoundError: No module named 'json'The reason is this line. The sys.path[:] is assigned to be a tuple, which somehow makes sys.path an empty list. I don't understand why a tuple is assigned to a list slice, nor why pypy3 behaves like this.
Changing this line to:
sys.path[:] = [p for p in sys.path if p != "" and normalize(p) != cwd]
solved the problem.
vthorsteinsson and scepeda78olliemath and scepeda78
Metadata
Metadata
Assignees
Labels
area-editor-*User-facing catch-allUser-facing catch-allbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug