vscode-jupyter: Wrong kernel name in metadata kernelspec when using kernel from virtualenv
Environment data
- VS Code version: 1.63.2
- Jupyter Extension version (available under the Extensions sidebar): v2021.11.1001550889
- Python Extension version (available under the Extensions sidebar): v2021.12.1559732655
- OS (Windows | Mac | Linux distro) and version: Ubuntu 18.04
- Python: Python 3.8
- Type of virtual environment used: virtualenv
- Jupyter server running: Local
Expected behaviour
I created a new virtual environment with the name venv_2
.
virtualenv venv_2 --python=python3.8
I add kernel to that venv:
python -m ipykernel install --user --name=venv_2
I created a new ipynb file in the VS Code and select kernel to venv_2 in the top right corner.
When I check the file of the notebook in the text editor I see the wrong kernelspec
in metadata
, it has name
set to python3
but it should be set to venv_2
.
The contents of the notebook:
... the rest of the notebook ...
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.0 64-bit ('venv_2': virtualenv)",
"language": "python",
"name": "python3"
},
It should be
... the rest of the notebook ...
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.0 64-bit ('venv_2': virtualenv)",
"language": "python",
"name": "venv_2"
},
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (16 by maintainers)
No apologies necessary, glad that you were able to verify this and get back to us. Thanks again for the confirmation.
@DonJayamanne sorry for the confusion. I’ve started VS Code after machine restart and looks like it is working!
Thank you very much! Closing the issue.
@pplonski Thanks for providing the information, I’m confused with the steps used to repro this issue, please could you provide the following information:
hash
information (this is added by VS Code, hence this must be removed) & the file name also changedjupyter
output panel (please provide all of the logs)Here’s the partial working branch. https://github.com/microsoft/vscode-jupyter/tree/rchiodo/use_kernel_name
I think we could either: