Flickering interpreter selection panel does not allow to select a Python interpreter
See original GitHub issueVS Code version
Version: 1.63.0-insider (user setup) Commit: 3a79384dbf81dc6eba781ff669996d2042ca3b72 Date: 2021-11-11T05:15:37.996Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.22000
Extension version
v2021.11.1422169775
OS type
Windows
OS version
11
Python distribution
python.org
Python version
3.9.2
Language server
Default
Expected behaviour
I should be able to select a Python interpreter from the selection panel
Actual behaviour
First, I think it is relevant to explain my project setup: I am running my project inside a Docker container using the remote containers extension. This project uses 3 containers, a back-end
(written in Python), a front-end
(NodeJS + React) and a workspace
container that VSCode will connect to once it finishes the docker-compose setup. It might not be relevant to the issue, but here is my devcontainer.json
file:
{
"name": "team32_project",
"dockerComposeFile": ["../docker-compose.yml", "docker-compose.workspace.yml"],
// The name of the service VS Code should connect to once running and
// an array of services that should be started by VS Code
"service": "workspace",
"runServices": ["back-end", "front-end"],
// Default path that VS Code should open when connecting to the container
"workspaceFolder": "/team32_project",
// Set *default* container specific settings on container create
"settings": {
// Automatically format Python code
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/back-end/.venv/bin/python",
"python.formatting.provider": "black",
// Automatically format JavaScript, TypeScript and JSON code
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.configPath": "${containerWorkspaceFolder}/front-end/.prettierrc",
"eslint.workingDirectories": ["${containerWorkspaceFolder}/front-end"],
"editor.formatOnSave": true
},
// Extensions that should be installed inside the container when it is created
"extensions": [
// Language support extensions
"bungcip.better-toml",
"ms-python.python",
// Formatting, linting and similar extensions
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode"
]
}
and here is workspace
container Dockerfile:
FROM alpine:3.14
WORKDIR /team32_project
# Install system dependencies
RUN apk update \
&& apk upgrade \
&& apk add --no-cache git
# Leave the container running so we can interact with it
CMD ["tail", "-f", "/dev/null"]
As you can see, I specified a suggested Python interpreter using the python.defaultInterpreterPath
, but it is not working at the moment. Once opened, the interpreter selection panel starts rapidly flickering and thus I cannot choose the interpreter. Moreover, when I try to select it manually, it does not work either. (you can see this behaviour in the youtube video that I linked below)
I tried to setup a multi-root workspace with no luck (I know that the extension does not support virtualenvs that are not in the project’s root directory)
Note: I also tried installing Python 3.9.2 inside the workspace
container and it gets recognized without issues, but my objective is to use the project’s virtual environment rather than the system’s one to have IntelliSense support for the packages that I’m using
Steps to reproduce
Unfortunately, the issue is difficult to describe without some evidence material, so I uploaded a short video of what I am experiencing: https://youtu.be/ivXpR4CbOhU
First, I try to select the interpreter under the back-end project root (as you can see by the path, which is ./.venv/bin/python
). Then, I try the same thing with the other project root (the path here is correct too, ./back-end/.venv/bin/python
). Eventually, I try to enter it manually but it still does not work
Logs
No response
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:9
Top GitHub Comments
Thanks for the bug report! We just wanted to quickly acknowledge we received it and we will triage this as soon as we can.
Please try the fix mentioned in https://github.com/microsoft/vscode-python/issues/18234#issuecomment-1012083554, if you still face the issue please provide the following info https://github.com/microsoft/vscode-python/issues/18007#issuecomment-998797786 and I’ll be happy to reopen the issue.