Vscode-jupyter: Unable to start session for kernel Python 3.8.5 32-bit

Created on 31 Aug 2020  ·  61Comments  ·  Source: microsoft/vscode-jupyter

Bug: Notebook Editor, Interactive Window, Editor cells

Unable to start session for kernel Python 3.8.5 32-bit ('venv': venv). Select another kernel to launch with.

Steps to cause the bug to occur

There is really nothing special here

  1. Clone repo and start VSCode
  2. Run python -m venv venv
  3. Switch interpreter to venv and restart terminal
  4. Create main.ipynb
  5. Install data-science package when automatically prompted
  6. Unable to start-session.

Actual behavior

Unable to start session for kernel Python 3.8.5 32-bit ('venv': venv). Select another kernel to launch with.

Expected behavior

Notebook runs!

Your Jupyter and/or Python environment

_Please provide as much info as you readily know_

  • Jupyter server running: Local
  • Extension version: v2020.8.105369
  • VS Code version: 1.48.2
  • Setting python.jediEnabled: I don't have this in my settings JSON file so default settings?
  • Setting python.languageServer: Microsoft
  • Python and/or Anaconda version: 3.8.5 32-bit
  • OS: Windows 10 Home 64-bit
  • Virtual environment: venv ...

Python Output


The notebook can't run so there is nothing to copy here. However, here is the installed package in the environment if it helps at all:

Package Version


argon2-cffi 20.1.0
attrs 20.1.0
backcall 0.2.0
bleach 3.1.5
cffi 1.14.2
colorama 0.4.3
decorator 4.4.2
defusedxml 0.6.0
entrypoints 0.3
flake8 3.8.3
ipykernel 5.3.4
ipython 7.18.1
ipython-genutils 0.2.0
ipywidgets 7.5.1
jedi 0.17.2
Jinja2 2.11.2
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.7
jupyter-console 6.2.0
jupyter-core 4.6.3
MarkupSafe 1.1.1
mccabe 0.6.1
mistune 0.8.4
nbconvert 5.6.1
nbformat 5.0.7
notebook 6.1.3
packaging 20.4
pandocfilters 1.4.2
parso 0.7.1
pickleshare 0.7.5
pip 20.1.1
prometheus-client 0.8.0
prompt-toolkit 3.0.7
pycodestyle 2.6.0
pycparser 2.20
pyflakes 2.2.0
Pygments 2.6.1
pyparsing 2.4.7
pyrsistent 0.16.0
python-dateutil 2.8.1
pywin32 228
pywinpty 0.5.7
pyzmq 19.0.2
qtconsole 4.7.6
QtPy 1.9.0
Send2Trash 1.5.0
setuptools 47.1.0
six 1.15.0
terminado 0.8.3
testpath 0.4.4
tornado 6.0.4
traitlets 5.0.0
wcwidth 0.2.5
webencodings 0.5.1
widgetsnbextension 3.5.1

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

bug

Most helpful comment

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

All 61 comments

Hello, I'm having a similar issue. It happens with any kernel I try to choose. Attaching a dev console log
-1598962107726.log

Hello,
almost the same issue:

Unable to start session for kernel Python 3.8.5 32-bit. Select another kernel to launch with.

Version: 1.48.2 (user setup)
Commit: a0479759d6e9ea56afa657e454193f72aef85bd0
Date: 2020-08-25T10:13:11.295Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 6.3.9600

kernel issue

upd:

appdirs 1.4.4
argon2-cffi 20.1.0
astroid 2.4.2
attrs 20.1.0
autopep8 1.5.4
backcall 0.2.0
black 19.3b0
bleach 3.1.5
certifi 2020.6.20
cffi 1.14.2
chardet 3.0.4
click 7.1.2
colorama 0.4.3
cycler 0.10.0
decorator 4.4.2
defusedxml 0.6.0
docutils 0.16
entrypoints 0.3
idna 2.10
ipykernel 5.3.4
ipython 7.18.1
ipython-genutils 0.2.0
ipywidgets 7.5.1
isort 5.4.2
jedi 0.17.2
Jinja2 2.11.2
joblib 0.16.0
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.7
jupyter-console 6.2.0
jupyter-core 4.6.3
kiwisolver 1.2.0
lazy-object-proxy 1.5.1
MarkupSafe 1.1.1
matplotlib 3.3.1
mccabe 0.6.1
mistune 0.8.4
mpmath 1.1.0
nbconvert 5.6.1
nbformat 5.0.7
notebook 6.1.3
numpy 1.19.1
packaging 20.4
pandas 1.1.1
pandocfilters 1.4.2
parso 0.8.0
pickleshare 0.7.5
Pillow 7.2.0
pip 20.2.2
plotly 4.9.0
prometheus-client 0.8.0
prompt-toolkit 3.0.7
pycodestyle 2.6.0
pycparser 2.20
pycryptodome 3.9.8
Pygments 2.6.1
pylint 2.6.0
pyparsing 2.4.7
pyrsistent 0.16.0
python-dateutil 2.8.1
pytz 2020.1
pywin32 228
pywinpty 0.5.7
pyzmq 19.0.2
qtconsole 4.7.6
QtPy 1.9.0
requests 2.24.0
retrying 1.3.3
rstcheck 3.3.1
scikit-learn 0.23.2
scipy 1.5.2
Send2Trash 1.5.0
setuptools 50.0.0
simple-crypt 4.1.7
six 1.15.0
sklearn 0.0
terminado 0.8.3
testpath 0.4.4
threadpoolctl 2.1.0
toml 0.10.1
tornado 6.0.4
traitlets 5.0.0
urllib3 1.25.10
wcwidth 0.2.5
webencodings 0.5.1
widgetsnbextension 3.5.1
wrapt 1.12.1

Similar issue with Python 3.8.5 64-bit, not using venv
output.txt

There is a workaround, you can use dependencies from an older workspace, if you have any. For example this set of requirements works in my case, but the updated ones not anymore. I don't know which version exactly causes the problem.


requirements.txt

absl-py==0.9.0
alembic==1.4.2
apispec==3.3.1
appdirs==1.4.4
astunparse==1.6.3
attrs==19.3.0
azure-core==1.6.0
azure-storage-blob==12.3.2
Babel==2.8.0
backcall==0.2.0
black==19.10b0
bleach==3.1.5
blinker==1.4
Boruta==0.3
cachetools==4.1.0
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
click==7.1.2
cloudpickle==1.4.1
convertdate==2.2.1
country-currencies==0.2
coverage==5.1
cryptography==2.9.2
cycler==0.10.0
databricks-cli==0.11.0
decorator==4.4.2
defusedxml==0.6.0
Deprecated==1.2.10
distlib==0.3.0
docker==4.2.1
eli5==0.10.1
entrypoints==0.3
et-xmlfile==1.0.1
fastavro==0.24.0
fastparquet==0.4.0
filelock==3.0.12
future==0.18.2
gast==0.3.3
gitdb==4.0.5
google-auth==1.18.0
google-auth-oauthlib==0.4.1
google-pasta==0.2.0
gorilla==0.3.0
graphviz==0.14
grpcio==1.30.0
gunicorn==20.0.4
h5py==2.10.0
holidays==0.10.3
hyperopt==0.2.4
idna==2.9
importlib-metadata==1.6.1
ipdb==0.13.3
ipykernel==5.3.0
ipython==7.15.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
isodate==0.6.0
itsdangerous==1.1.0
jdcal==1.4.1
jedi==0.17.1
jellyfish==0.8.2
Jinja2==2.11.2
joblib==0.16.0
jsonpointer==2.0
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==6.1.3
jupyter-console==6.1.0
jupyter-core==4.6.3
kafka-python==2.0.1
Keras-Preprocessing==1.1.2
kiwisolver==1.2.0
korean-lunar-calendar==0.2.1
llvmlite==0.33.0
Mako==1.1.3
Markdown==3.2.2
MarkupSafe==1.1.1
marshmallow==3.7.1
marshmallow-jsonschema==0.10.0
matplotlib==3.2.2
mistune==0.8.4
more-itertools==8.4.0
msgpack==1.0.0
msrest==0.6.16
nbconvert==5.6.1
nbformat==5.0.7
networkx==2.4
notebook==6.0.3
numba==0.50.0
numpy==1.19.1
oauthlib==3.1.0
openpyxl==3.0.1
opt-einsum==3.2.1
packaging==20.4
pandas==1.1.0
pandocfilters==1.4.2
parso==0.7.0
pathspec==0.8.0
pexpect==4.8.0
phonenumbers==8.12.7
pickleshare==0.7.5
Pillow==7.2.0
plotly==4.8.1
pluggy==0.13.1
prometheus-client==0.8.0
prometheus-flask-exporter==0.14.1
prompt-toolkit==3.0.5
protobuf==3.12.2
psutil==5.7.2
psycopg2-binary==2.8.5
ptvsd==4.3.2
ptyprocess==0.6.0
py==1.8.2
pyarrow==1.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.20
Pygments==2.6.1
PyMeeus==0.3.7
pyparsing==2.4.7
pyrsistent==0.16.0
pytest==5.4.3
pytest-cov==2.10.0
python-dateutil==2.8.1
python-editor==1.0.4
pytz==2020.1
PyYAML==5.3.1
pyzmq==19.0.1
qtconsole==4.7.5
QtPy==1.9.0
querystring-parser==1.2.4
regex==2020.6.8
requests==2.24.0
requests-oauthlib==1.3.0
responses==0.10.15
retrying==1.3.3
rfc3339-validator==0.1.2
rfc3986-validator==0.1.1
rsa==4.6
scikit-learn==0.23.1
scipy==1.4.1
seaborn==0.10.1
Send2Trash==1.5.0
sentry-sdk==0.16.3
shap==0.35.0
six==1.15.0
smmap==3.0.4
tabulate==0.8.7
termcolor==1.1.0
terminado==0.8.3
testpath==0.4.4
threadpoolctl==2.1.0
thrift==0.13.0
toml==0.10.1
tornado==6.0.4
traitlets==4.3.3
typed-ast==1.4.1
typing-extensions==3.7.4.2
urllib3==1.25.9
uWSGI==2.0.19.1
virtualenv==20.0.25
wcwidth==0.2.5
webargs==5.5.3
webcolors==1.11.1
webencodings==0.5.1
websocket-client==0.57.0
widgetsnbextension==3.5.1
wrapt==1.12.1
zipp==3.1.0

There is a workaround, you can use dependencies from an older workspace, if you have any. For example this set of requirements works in my case, but the updated ones not any more. I don't know which version exactly causes the problem.

Actually just pip install notebook==6.0.3 works for me

Edit: complete requirements.txt that works, few packages downgraded.
requirements.txt

@Krendelev Unfortunately this workaround isn't working for me.

Just want to echo I have the same issue starting this morning and it seems like microsoft/vscode-jupyter#685 may be referring to the same problem.

Strangely, this bug is also present when using devcontainers.
It doesn't seem to be linked to the version of Python.

Looking into it now. The logs that I've seen all have signature mismatch issues.

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

If this works (or doesn't) for you please post back as I have only my data point to work with.

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

Confirming that this resolves the issue. Thank you for looking into it.

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history
In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

Confirmed on my end (Python3.8.5 64-bit; Windows).

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

This really helped!

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

Thank you very much

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

I just started today with VScode+jupyter (was already in with anaconda).
This issue really tired me up and took my 4-5 hours to get to this post.
FIrstly there was some compatibility issue with conda env kernel and then this stuff came up.
but this solution saved my day. Thanks a lot

Thank you very much!
It is working now.
Quotation marks are not necessary:

python3 -m pip install traitlets==4.3.3 --force-reinstall

or

pip3 install traitlets==4.3.3 --force-reinstall

On Tue, Sep 1, 2020 at 11:56 AM liteform notifications@github.com wrote:

Hey folks. In my local testing I believe that it was this update here to
5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop
it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in
the background, this will make sure that you pick up the install fresh the
next time that you start).

Confirming that this resolves the issue. Thank you for looking into it.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-python/issues/13701#issuecomment-684998235,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACM2HQQAJZTBZHEHLI243SLSDURSLANCNFSM4QQ4BE3Q
.

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

perfect for me! thanks!

I feel like I'm missing something? When I run python -m pip install 'traitlets==4.3.3' --force-reinstall and then open up VS Code and start up a new notebook, it tells me Data Science library ipykernel is not installed. Install? And if I select "Yes" it will update and then send me back to the Unable to start session for kernel Python 3.8.5 32-bit. Basically putting me in a loop.

python -m pip install 'traitlets==4.3.3' --force-reinstall confirmed to work for me. Thanks a lot.

Python 3.8.5 32-bit on Windows 10 64-bit

python3 -m pip install traitlets==4.3.3 --force-reinstall worked for me as well. Python 3.8.2 64-bit on Windows 10 64-bit

I feel like I'm missing something? When I run python -m pip install 'traitlets==4.3.3' --force-reinstall and then open up VS Code and start up a new notebook, it tells me Data Science library ipykernel is not installed. Install? And if I select "Yes" it will update and then send me back to the Unable to start session for kernel Python 3.8.5 32-bit. Basically putting me in a loop.

Go to vscode (change the python interpreter to what you want), then run
python -m pip install ipykernel
and then do the degradation by
python -m pip install 'traitlets==4.3.3' --force-reinstall

because when you are degrading it first then the installation of ipykernel updates it again nullfying your degradation

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

Confirmed on my end (Python3.8.5 64-bit; Windows).

"python -m pip install traitlets==4.3.3 --force-reinstall --user"
It works perfectly now! Thanks very much!!!!!

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

also works for me, thank you!

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

It worked, thanks!

Thank you very much! It is working now. Quotation marks are not necessary: python3 -m pip install traitlets==4.3.3 --force-reinstall or pip3 install traitlets==4.3.3 --force-reinstall

On Tue, Sep 1, 2020 at 11:56 AM liteform @.*> wrote: Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install: https://pypi.org/project/traitlets/#history In an activated environment that is not working try the following to drop it back to the older version: python -m pip install 'traitlets==4.3.3' --force-reinstall Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start). Confirming that this resolves the issue. Thank you for looking into it. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#13701 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACM2HQQAJZTBZHEHLI243SLSDURSLANCNFSM4QQ4BE3Q .

Really worked!

Go to vscode (change the python interpreter to what you want), then run
python -m pip install ipykernel
and then do the degradation by
python -m pip install 'traitlets==4.3.3' --force-reinstall

because when you are degrading it first then the installation of ipykernel updates it again nullfying your degradation

Well, like I said, I seem to be stuck in a loop. if I install ipykernel, then I can't start a session. So then I need to do the degradation. But the problem here is that if I degrade it, vscode keeps telling me that I don't have an ipykernel installed. Therefore, it still doesn't work.

Here's the other thing, after running python -m pip install 'traitlets==4.3.3' --force-reinstall, if I were to install ipykernel with pip, nothing happens as all my requirement are satisfied. Its just that if I try to select an interpreter for notebooks, again, vscode will force me to install Data Science library ipykernel and it will add Installing collected packages: ipython-genutils, traitlets, six, decorator. This seems to be the only difference between installing through VS Code and using python -m pip install ipykernel.

I should also add that this is my first time installing and running notebooks on vscode, so I don't have any older versions to revert back to maybe? I'm honestly not sure what's going on.

@dwang040 Sounds like you are dealing with a different issue here. Could you please file a new issue on this? Also turning Python->Logging->Level setting to 'debug' and then including the contents of the Output:Python window could help us to diagnose this.

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

Also works very well for me, thanks

If someone here is using pipenv to manage your packages, use the command below to install this package

pipenv install jupyter
pipenv install traitlets==4.3.3

With both commands you can create the complete environment to work with jupyter notebook on vscode.

OMG!!!! You guys have just saved my life!!!!
I've been trying to solve this problem for HOURS!!!!

I'm using Ubuntu 20.04. I've installed jupyter using "sudo pip3 install jupyter" in the terminal and jupyter notebook was working completely fine in the browser. However, when I tried to create a notebook in VSCode I got the message "Connecting to IPython kernel: Connecting to kernel", and, after some minutes, the message "Unable to start session for kernel python 3.8".

As suggested here, first I exited VSCode.
Then I checked the version of "traitlets" installed, using the following command in ubuntu terminal:

$ pip3 freeze | grep traitlets

And it was installed some 5 version...

Then, I used the following command in ubuntu terminal:

$ sudo pip3 install "traitlets==4.3.3" --force-reinstall

Reopened VSCode and ran a notebook! Worked PERFECTLY!!!!

Thank you very much you all, specially @IanMatthewHuff !!!!

Worked for me too - python 3.8.5 on 64-bit windows10

If this works (or doesn't) for you please post back as I have only my data point to work with.

Thanks a lot! this solved my problem:

Unable to start session for kernel Python 3.7.7 64-bit ('venv': venv). Select another kernel to launch with.

Thank you very much! It is working now. Quotation marks are not necessary: python3 -m pip install traitlets==4.3.3 --force-reinstall or pip3 install traitlets==4.3.3 --force-reinstall

This worked - 3.8.3 64bit MacOS, thank you! :)

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

Works for me 👍

This worked for me, following the instructions for Pipenv mentioned by @pedrom505

Thank you!!

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

Worked for me, thank you! But is there anyone working on a more permanent fix that works with the latest version of traitlets and other things?

Hi,
I tried the solutions above, but they did not work for me. I also tried the solutions here, but they did not work either. I'm very new to visual studio so all help is appreciated. Thank you!

Worked easily and well for me. Many thanks @IanMatthewHuff and team!

python -m pip install 'traitlets==4.3.3' --force-reinstall
Yes it worked for me as well :-)

This should be fixed with latest traitlets 5.0.4, out earlier today. I haven't been able to confirm directly, since I don't know how to trigger the relevant code path myself, but manually executing a similar command-line is fixed with 5.0.4.

But is there anyone working on a more permanent fix that works with the latest version of traitlets and other things?

This extension shouldn't need any updating, but the relevant change is that this b' prefix for configuring Bytes on the command-line is no longer required and support is deprecated (with no plans for removal). The bug was in traitlets 5,<5.0.4 not properly implementing the deprecated support for this prefix. It can be dropped if/when traitlets >=5.0 is required, but until then no changes are necessary. I wouldn't rush, though, as pinning down is likely to be a common practice as bugs are worked out during a transition period.

This should be fixed with latest traitlets 5.0.4, out earlier today. I haven't been able to confirm directly, since I don't know how to trigger the relevant code path myself, but manually executing a similar command-line is fixed with 5.0.4.

But is there anyone working on a more permanent fix that works with the latest version of traitlets and other things?

This extension shouldn't need any updating, but the relevant change is that this b' prefix for configuring Bytes on the command-line is no longer required and support is deprecated (with no plans for removal). The bug was in traitlets 5,<5.0.4 not properly implementing the deprecated support for this prefix. It can be dropped if/when traitlets >=5.0 is required, but until then no changes are necessary. I wouldn't rush, though, as pinning down is likely to be a common practice as bugs are worked out during a transition period.

-This worked for me

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

This worked for me - Thank you!
Python 3.8.5
MacOS 10.15.6

I had traitlets 4.3.3 installed already, so I tried upgrading. In the respective conda env, I upgraded traitlets to 5.0.4 and still get the kernelspec error unless I open vscode via the anaconda3 command prompt.

Interestingly this issue is not present when I run an interpreter on the host from a remote client via the SSH remote extension

python 3.7.7
vs code 1.49
win10 x64

Worked for me. Thanks!
Python 3.8.5
vscode 1.49
win10 x64

Hope to solve this problem, I spent a long time to solve this problem, but those who did not see this page are not so lucky, maybe they will give up using VSCODE's jupyter notebook function

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

WORKED! Thank You :))

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

This is great! Fixed the issue.
Cheers!

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

traitlets==4.3.3 worked for me also thank you!

This should be fixed with latest traitlets 5.0.4, out earlier today.

I can confirm that upgrade to 5.0.4 fixed it for me:
pip3 install -U traitlets

Not work for me.
Python 3.7.4
Windows 10
vscode 1.49.2

The same problem, nothing works for me.
I´ve tried upgrading traitlets to 5.04, I´ve tried traitlets 4.3.3.
I´m working with Anaconda, I created a new enviroment, where I install Ipykernel
conda install ipykernel
ipython kernel install --name my_env --user
Python 3.8.3
Windows 10
vscode 1.49.2

@Brelliothe and @rocooper7 . There are different issues that can manifest as the same session start issues. At this point we have a number of confirmations that the traitlets issue is fixed. Can you please open up new issues for your reports? And please set the setting Python->Logging->Level to 'debug' then copy out the contents of the python output window into a file. You can then post that file attached to your issue and it will greatly help with debugging.

python -m pip install 'traitlets==4.3.3' --force-reinstall
got an error message.
try:
pip uninstall traitlets
pip install traitlets

works for me. thanks.

python -m pip install 'traitlets==4.3.3' --force-reinstall
got an error message.
try:
pip uninstall traitlets
pip install traitlets

works for me. thanks.

This worked for me as well!

Hey folks. In my local testing I believe that it was this update here to 5.0.0, which is picked up as part of our ipykernel install:
https://pypi.org/project/traitlets/#history

In an activated environment that is not working try the following to drop it back to the older version:
python -m pip install 'traitlets==4.3.3' --force-reinstall
Make sure to have VS Code closed (as we sometimes are starting a kernel in the background, this will make sure that you pick up the install fresh the next time that you start).

Thanks very much. It works perfect now

There is a workaround, you can use dependencies from an older workspace, if you have any. For example this set of requirements works in my case, but the updated ones not any more. I don't know which version exactly causes the problem.

Actually just pip install notebook==6.0.3 works for me

Edit: complete requirements.txt that works, few packages downgraded.
requirements.txt

Works for me

I found that Code (OSS) tries to open the system Python by default, at least in version v2020.9.112786 of the extension. If you don't have ipykernel installed to the system Python, then it keeps trying to activate that environment, even if you try to select another.

For me, I installed python-ipykernel on Arch Linux and this fixed the issue. I can now use my Anaconda environment just fine.

yay -S python-ipykernel

It's a workaround for now, at least until the Python plugin stops doing this.

Doesn't work for me. Python 3.9.0 64-bit.

steps:

  1. uninstall ipykernel
  2. reinstall ipkernel
  3. do downgrade
  4. error; Timed out waiting to get a heartbeat from kernel process

Doesn't work for me. Python 3.9.0 64-bit.

steps:

  1. uninstall ipykernel
  2. reinstall ipkernel
  3. do downgrade
  4. error; Timed out waiting to get a heartbeat from kernel process

Hello,
have you tried (#14274)?

Solved the issue by recreating venv

Was this page helpful?
0 / 5 - 0 ratings