question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't start ipykernel when launching vscode from WSL

See original GitHub issue

Bug: Notebook Editor, Interactive Window, Editor cells

Steps to cause the bug to occur

  1. Start VS Code from WSL
  2. Create a python virtual environment and select it as python interpreter
  3. Activate the virtual environment and install ipykernel
  4. Create and edit a .ipynb file
  5. Execute it

Actual behavior

Notification area shows this message

StdErr from ShellExec, your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble for . /home/revz/devel/python/notebooks/catch4/env/bin/activate && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/printEnvVariables.py

Expected behavior

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2020.9.114305
  • VS Code version: 1.50.1 (user setup)
  • Setting python.jediEnabled: using pylance
  • Setting python.languageServer: Pylance
  • Python and/or Anaconda version: 3.8.5
  • OS: Windows_NT x64 10.0.20236 - WSL2 Ubuntu 20.04
  • Virtual environment: venv

Python Output

Error 2020-10-19 13:01:19: Jupyter Kernel Spec not found for a local connection Error 2020-10-19 13:01:20: getActivatedEnvironmentVariables [Error: StdErr from ShellExec, your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble for . /home/revz/devel/python/notebooks/catch4/env/bin/activate && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (/home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/out/client/extension.js:56:799964) at processTicksAndRejections (internal/process/task_queues.js:94:5)] Error 2020-10-19 13:01:20: getActivatedEnvironmentVariables, Class name = E, completed in 235ms, has a falsy return value, Arg 1: Uri:/home/revz/devel/python/notebooks/catch4/test.ipynb, Arg 2: {“architecture”:3,“path”:“/home/revz/devel/python/notebooks/catch4/env/bin/python”,“version”:{“options”:{“loose”:false,“includePrerelease”:false},“loose”:false,“raw”:“3.8.5-final”,“major”:3,“minor”:8,“patch”:5,“prerelease”:[“final”],“build”:[],“version”:“3.8.5-final”},“sysPrefix”:“/home/revz/devel/python/notebooks/catch4/env”,“fileHash”:“a68d09f1a0ebabab404ab39bc948d0b28b61f6b8e6b44b7fff5f4a71ac9ef778fe34d590e084adfb6146fc43ca720e4fe30def837aab7e80ec22da55a3baeed2”,“envName”:“env”,“type”:“Venv”,“displayName”:“Python 3.8.5 64-bit (‘env’)”}, Arg 3: true [Error: StdErr from ShellExec, your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble for . /home/revz/devel/python/notebooks/catch4/env/bin/activate && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (/home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/out/client/extension.js:56:799964) at processTicksAndRejections (internal/process/task_queues.js:94:5)] Error 2020-10-19 13:01:20: Failed to create the daemon service, defaulting to activated environment [Error: StdErr from ShellExec, your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble for . /home/revz/devel/python/notebooks/catch4/env/bin/activate && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (/home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/out/client/extension.js:56:799964) at processTicksAndRejections (internal/process/task_queues.js:94:5)] Error 2020-10-19 13:01:20: Failed to connect raw kernel session: Error: StdErr from ShellExec, your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble for . /home/revz/devel/python/notebooks/catch4/env/bin/activate && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/printEnvVariables.py Error 2020-10-19 13:01:20: DataScience Error [Error: StdErr from ShellExec, your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble for . /home/revz/devel/python/notebooks/catch4/env/bin/activate && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (/home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/out/client/extension.js:56:799964) at processTicksAndRejections (internal/process/task_queues.js:94:5)] Error 2020-10-19 13:01:20: getActivatedEnvironmentVariables [Error: StdErr from ShellExec, your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble for . /home/revz/devel/python/notebooks/catch4/env/bin/activate && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (/home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/out/client/extension.js:56:799964) at processTicksAndRejections (internal/process/task_queues.js:94:5)] Error 2020-10-19 13:01:20: getActivatedEnvironmentVariables, Class name = E, completed in 282ms, has a falsy return value, Arg 1: Uri:/home/revz/devel/python/notebooks/catch4/test.ipynb, Arg 2: {“architecture”:3,“path”:“/home/revz/devel/python/notebooks/catch4/env/bin/python”,“version”:{“options”:{“loose”:false,“includePrerelease”:false},“loose”:false,“raw”:“3.8.5-final”,“major”:3,“minor”:8,“patch”:5,“prerelease”:[“final”],“build”:[],“version”:“3.8.5-final”},“sysPrefix”:“/home/revz/devel/python/notebooks/catch4/env”,“fileHash”:“a68d09f1a0ebabab404ab39bc948d0b28b61f6b8e6b44b7fff5f4a71ac9ef778fe34d590e084adfb6146fc43ca720e4fe30def837aab7e80ec22da55a3baeed2”,“envName”:“env”,“type”:“Venv”,“displayName”:“Python 3.8.5 64-bit (‘env’)”}, Arg 3: true [Error: StdErr from ShellExec, your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble for . /home/revz/devel/python/notebooks/catch4/env/bin/activate && echo ‘e8b39361-0157-4923-80e1-22d70d46dee6’ && python /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/pyvsc-run-isolated.py /home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/pythonFiles/printEnvVariables.py at E.getActivatedEnvironmentVariablesImpl (/home/revz/.vscode-server/extensions/ms-python.python-2020.9.114305/out/client/extension.js:56:799964) at processTicksAndRejections (internal/process/task_queues.js:94:5)]

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
rchiodocommented, Nov 18, 2020

This isn’t reproing for me anymore. Works fine if I:

  1. Launch Code from a WSL prompt
  2. Install a new venv
  3. Run a cell in the interactive window (it will ask to install ipykernel and then the interactive window opens).
0reactions
tarasivashchukcommented, Dec 4, 2020

FYI this happens if you exit VS Code with an open instance of the integrated terminal. To fix:

  1. close all your integrated terminals
  2. exit vscode
  3. restart wsl
  4. open vscode from a wsl shell
  5. open your notebook before opening an integrated terminal
  6. boom
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to start session for jupyter kernel python vscode
Select another kernel to launch with. I am using wsl 2 with ubuntu 20.04 LTS and I have selected the correct python interpreter...
Read more >
Working with Jupyter Notebooks in Visual Studio Code
If you have an existing Jupyter Notebook, you can open it by right-clicking on the file and opening with VS Code, or through...
Read more >
Using C++ and WSL in VS Code
Navigate to your helloworld project folder and launch VS Code from the WSL terminal with code . : cd $HOME/projects/helloworld code .
Read more >
June 2021 (version 1.58) - Visual Studio Code
When debugging is started without a launch.json file, VS Code looks at the active editor and based on the language mode of the...
Read more >
November 2021 (version 1.63) - Visual Studio Code
Avoid starting default kernel when starting jupyter. (#8185); Avoid looking for IPyKernel when we've found it once before. (#8196); Avoid unnecessarily ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found