vscode-jupyter: Failing to detect ipykernel module

Steps to cause the bug to occur

  1. Right click on script "Run in interactive window.

Actual behavior

Loads forever. Notifys that ipykernel is not installed image

Expected behavior

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2020.01
  • VS Code version: 1.39.2
  • Setting python.jediEnabled: true
  • Python and/or Anaconda version: 3.6
  • OS: Windows
  • Virtual environment: conda

image

Developer Tools Console Output

Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Failed executing an rpc method. Error: Traceback (most recent call last):  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py", line 12, in <module>    for si in server_list:  File "C:\ProgramData\CooperConda\lib\site-packages\notebook\notebookapp.py", line 1888, in list_running_servers    with io.open(os.path.join(runtime_dir, file_name), encoding='utf-8') as f:FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\skmeenak\\AppData\\Roaming\\jupyter\\runtime\\nbserver-15404.json'During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\daemon\daemon_python.py", line 54, in _decorator    return func(self, *args, **kwargs)  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\daemon\daemon_python.py", line 133, in m_exec_file    return self._execute_and_capture_output(exec_file)  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\daemon\daemon_python.py", line 104, in _execute_and_capture_output    func()  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\daemon\daemon_python.py", line 130, in exec_file    runpy.run_path(file_name, globals())  File "C:\ProgramData\CooperConda\lib\runpy.py", line 263, in run_path    pkg_name=pkg_name, script_name=fname)  File "C:\ProgramData\CooperConda\lib\runpy.py", line 96, in _run_module_code    mod_name, mod_spec, pkg_name, script_name)  File "C:\ProgramData\CooperConda\lib\runpy.py", line 85, in _run_code    exec(code, run_globals)  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py", line 29, in <module>    result = subprocess.run(['jupyter', 'notebook', 'list', '--jsonlist'], capture_output=True)  File "C:\ProgramData\CooperConda\lib\subprocess.py", line 423, in run    with Popen(*popenargs, **kwargs) as process:TypeError: __init__() got an unexpected keyword argument 'capture_output'
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Cached data exists ActivatedEnvironmentVariables, <No Resource>
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: getActivatedEnvironmentVariables, Class name = b, completed in 1ms, Arg 1: undefined, Arg 2: undefined, Arg 3: true
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: [I 15:33:43.277 NotebookApp] JupyterLab extension loaded from C:\ProgramData\CooperConda\lib\site-packages\jupyterlab[I 15:33:43.278 NotebookApp] JupyterLab application directory is C:\ProgramData\CooperConda\share\jupyter\lab[I 15:33:43.280 NotebookApp] Serving notebooks from local directory: C:\Users\skmeenak\AppData\Local\Temp\10fdc1fc-a08f-4b42-a595-509969ab45b6[I 15:33:43.280 NotebookApp] The Jupyter Notebook is running at:[I 15:33:43.281 NotebookApp] http://localhost:8888/?token=74dea3721d973d3161da3c20162c4941be761ebf0b05c4f8[I 15:33:43.281 NotebookApp]  or http://127.0.0.1:8888/?token=74dea3721d973d3161da3c20162c4941be761ebf0b05c4f8[I 15:33:43.281 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).[C 15:33:43.287 NotebookApp]         To access the notebook, open this file in a browser:        file:///C:/Users/skmeenak/AppData/Roaming/jupyter/runtime/nbserver-11364-open.html    Or copy and paste one of these URLs:        http://localhost:8888/?token=74dea3721d973d3161da3c20162c4941be761ebf0b05c4f8     or http://127.0.0.1:8888/?token=74dea3721d973d3161da3c20162c4941be761ebf0b05c4f8
console.ts:137 [Extension Host] Warn Python Extension: 2020-01-13 15:33:43: Falling back to Python Execution Service due to failure in daemon { Error: Failed to execute using the daemon, Traceback (most recent call last):  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py", line 12, in <module>    for si in server_list:  File "C:\ProgramData\CooperConda\lib\site-packages\notebook\notebookapp.py", line 1888, in list_running_servers    with io.open(os.path.join(runtime_dir, file_name), encoding='utf-8') as f:FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\skmeenak\\AppData\\Roaming\\jupyter\\runtime\\nbserver-15404.json'During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\daemon\daemon_python.py", line 54, in _decorator    return func(self, *args, **kwargs)  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\daemon\daemon_python.py", line 133, in m_exec_file    return self._execute_and_capture_output(exec_file)  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\daemon\daemon_python.py", line 104, in _execute_and_capture_output    func()  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\daemon\daemon_python.py", line 130, in exec_file    runpy.run_path(file_name, globals())  File "C:\ProgramData\CooperConda\lib\runpy.py", line 263, in run_path    pkg_name=pkg_name, script_name=fname)  File "C:\ProgramData\CooperConda\lib\runpy.py", line 96, in _run_module_code    mod_name, mod_spec, pkg_name, script_name)  File "C:\ProgramData\CooperConda\lib\runpy.py", line 85, in _run_code    exec(code, run_globals)  File "c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py", line 29, in <module>    result = subprocess.run(['jupyter', 'notebook', 'list', '--jsonlist'], capture_output=True)  File "C:\ProgramData\CooperConda\lib\subprocess.py", line 423, in run    with Popen(*popenargs, **kwargs) as process:TypeError: __init__() got an unexpected keyword argument 'capture_output'    at t.PythonDaemonExecutionService.processResponse (c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\src\client\common\process\pythonDaemon.ts:214:1)    at t.PythonDaemonExecutionService.processResponse [as execFileWithDaemon] (c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\src\client\common\process\pythonDaemon.ts:229:1)  message:   'Failed to execute using the daemon, Traceback (most recent call last):\n  File "c:\\Users\\skmeenak\\.vscode\\extensions\\ms-python.python-2020.1.58038\\pythonFiles\\datascience\\getServerInfo.py", line 12, in <module>\n    for si in server_list:\n  File "C:\\ProgramData\\CooperConda\\lib\\site-packages\\notebook\\notebookapp.py", line 1888, in list_running_servers\n    with io.open(os.path.join(runtime_dir, file_name), encoding=\'utf-8\') as f:\nFileNotFoundError: [Errno 2] No such file or directory: \'C:\\\\Users\\\\skmeenak\\\\AppData\\\\Roaming\\\\jupyter\\\\runtime\\\\nbserver-15404.json\'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "c:\\Users\\skmeenak\\.vscode\\extensions\\ms-python.python-2020.1.58038\\pythonFiles\\datascience\\daemon\\daemon_python.py", line 54, in _decorator\n    return func(self, *args, **kwargs)\n  File "c:\\Users\\skmeenak\\.vscode\\extensions\\ms-python.python-2020.1.58038\\pythonFiles\\datascience\\daemon\\daemon_python.py", line 133, in m_exec_file\n    return self._execute_and_capture_output(exec_file)\n  File "c:\\Users\\skmeenak\\.vscode\\extensions\\ms-python.python-2020.1.58038\\pythonFiles\\datascience\\daemon\\daemon_python.py", line 104, in _execute_and_capture_output\n    func()\n  File "c:\\Users\\skmeenak\\.vscode\\extensions\\ms-python.python-2020.1.58038\\pythonFiles\\datascience\\daemon\\daemon_python.py", line 130, in exec_file\n    runpy.run_path(file_name, globals())\n  File "C:\\ProgramData\\CooperConda\\lib\\runpy.py", line 263, in run_path\n    pkg_name=pkg_name, script_name=fname)\n  File "C:\\ProgramData\\CooperConda\\lib\\runpy.py", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File "C:\\ProgramData\\CooperConda\\lib\\runpy.py", line 85, in _run_code\n    exec(code, run_globals)\n  File "c:\\Users\\skmeenak\\.vscode\\extensions\\ms-python.python-2020.1.58038\\pythonFiles\\datascience\\getServerInfo.py", line 29, in <module>\n    result = subprocess.run([\'jupyter\', \'notebook\', \'list\', \'--jsonlist\'], capture_output=True)\n  File "C:\\ProgramData\\CooperConda\\lib\\subprocess.py", line 423, in run\n    with Popen(*popenargs, **kwargs) as process:\nTypeError: __init__() got an unexpected keyword argument \'capture_output\'\n' }
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
_protocol.onMessage.e @ rpcProtocol.ts:101
fire @ event.ts:580
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
_socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:592
fire @ event.ts:580
acceptChunk @ ipc.net.ts:239
_register._socket.onData.e @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:182
addChunk @ _stream_readable.js:283
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onStreamRead @ internal/stream_base_commons.js:94
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: > C:\ProgramData\CooperConda\python.exe c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: pinged with hello
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: > C:\ProgramData\CooperConda\python.exe (daemon) c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Exec file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py with args []
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: execute file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: pinged with hello
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: > C:\ProgramData\CooperConda\python.exe (daemon) c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Exec file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py with args []
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: execute file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: pinged with hello
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: > C:\ProgramData\CooperConda\python.exe (daemon) c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Exec file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py with args []
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: execute file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: pinged with hello
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: > C:\ProgramData\CooperConda\python.exe (daemon) c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Exec file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py with args []
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: execute file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: pinged with hello
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: > C:\ProgramData\CooperConda\python.exe (daemon) c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method exec_file
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Exec file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py with args []
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: execute file c:\Users\skmeenak\.vscode\extensions\ms-python.python-2020.1.58038\pythonFiles\datascience\getServerInfo.py
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: Execute rpc method ping
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:43: Python Daemon: pinged with hello
notificationsAlerts.ts:40 Data Science library ipykernel is not installed. Install?
onDidNotificationChange @ notificationsAlerts.ts:40
_register.model.onDidNotificationChange.e @ notificationsAlerts.ts:26
fire @ event.ts:580
addNotification @ notifications.ts:156
notify @ notificationService.ts:100
r @ mainThreadMessageService.ts:83
_showMessage @ mainThreadMessageService.ts:44
$showMessage @ mainThreadMessageService.ts:38
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
_protocol.onMessage.e @ rpcProtocol.ts:101
fire @ event.ts:580
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
_socketDisposables.push._socketReader.onMessage.e @ ipc.net.ts:592
fire @ event.ts:580
acceptChunk @ ipc.net.ts:239
_register._socket.onData.e @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:182
addChunk @ _stream_readable.js:283
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onStreamRead @ internal/stream_base_commons.js:94
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:45: Python Daemon: Execute rpc method ping in DS Daemon
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:45: Python Daemon: Execute rpc method ping
console.ts:137 [Extension Host] Info Python Extension: 2020-01-13 15:33:45: Python Daemon: pinged with hello

Also it appears to be intermittent…at lease on one occasion today the user reported and showed me that it did “Work” and the ipython kernel was started. I couldn’t tell whether it was daemon or fallback.

Let me know if you need any more details.

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 43 (17 by maintainers)

Most upvoted comments

Ok I took control of the users computer and did some more exploring. I can now reproduce the “spinning forever” and the action which causes it to be “magically fixed”.

  1. Do a clean restart of VS Code
  2. Run the current script in interactive terminal: image
  3. The ipykernel message will appear. image
  4. The status says “Starting jupter server” indefinitely image
  5. and the Python Interactive window looks like this with the loading animation indefinitely: image

Here’s the clue and source of intermittent behaviour: Everything gets unblocked when I click the x on the notification message which misidentified that ipykernel was not installed. If I had done step 2 multiple times they had been queued and the script will run multiple times.

@DonJayamanne seems that after I removed the conda command from my .bashrc it started working (I actually tried that right away). Weird, I am not using bash as a shell anymore (in mac os Catalina) so I don’t understand why that is affecting VS code (in fact, I don’t understand why my .bashrc file is even being ran).

Somehow removing all errors makes the jupyter notebook work, but I don’t think this is the intended way to have this work for the user, right? Why did I have to go through this if conda was working for my zsh and I am not using bash anymore. Is this a bug with VS code?

From a user’s perspective I expected it to work out of the box but it didn’t…is what Im trying to say.

see my SO for details: https://stackoverflow.com/questions/59867847/how-does-one-connect-a-jupyter-kernel-to-vs-code-if-one-does-not-connect-automat


Copy pasted from my SO question :

I want to be able to have a working jupyter notebook working for VS code out of the box, with minimal work on my side.

I tried opening a jupyter notebook. I immediately found the interpreter and used my conda env with the command pellet (command + shift + P then in the drop down menu found my conda env). This seems to make the terminal work since which python points to the right place:

(automl-meta-learning) brandomiranda~/automl-meta-learning ❯ which python
/Users/brandomiranda/miniconda3/envs/automl-meta-learning/bin/python

also running python scripts from VS Code seems to be working fine too, see output:

(automl-meta-learning) brandomiranda~/automl-meta-learning ❯ /Users/brandomiranda/miniconda3/envs/automl-meta-learning/bin/python /Users/brandomiranda/automl-meta-learning/python_playground.py

x = 1
my_str = this is a string
y = 2

but when I try the jupyter notebook it doesn’t work.

Most noticeably my VS code does not have a kernel connected, look at the screenshot:

enter image description here

I tried clicking on a couple of arrows as suggested on reddit (vs_code_jupyter_server_no_kernel_python_not):

enter image description here

When I try running things in my jupyter notebook I get the following error:

Error: Activating Python 3.7.6 64-bit ('base': conda) to run Jupyter failed with Error: StdErr from ShellExec, /Users/brandomiranda/.bashrc: line 31: jump-module.bash: No such file or directory

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init 

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.


.

which is strange. My shell is not even bash so I don’t know why that message is being shown to me (maybe VS Code doesn’t know Mac OS Catalina uses zsh? not sure how to fix that for VS Code). Regardless, I proceeded to do what I think the error message is suggesting. So I did the following:

I ran conda init and then went down to the terminal inside vs code and restarted the shell by running zsh but the jupyter kernel still doesn’t work on my notebook in vs code. Not sure what’s wrong.

In addition, I did what the error message suggested:

(automl-meta-learning) brandomiranda~/automl-meta-learning ❯ conda init zsh
no change     /Users/brandomiranda/miniconda3/condabin/conda
no change     /Users/brandomiranda/miniconda3/bin/conda
no change     /Users/brandomiranda/miniconda3/bin/conda-env
no change     /Users/brandomiranda/miniconda3/bin/activate
no change     /Users/brandomiranda/miniconda3/bin/deactivate
no change     /Users/brandomiranda/miniconda3/etc/profile.d/conda.sh
no change     /Users/brandomiranda/miniconda3/etc/fish/conf.d/conda.fish
no change     /Users/brandomiranda/miniconda3/shell/condabin/Conda.psm1
no change     /Users/brandomiranda/miniconda3/shell/condabin/conda-hook.ps1
no change     /Users/brandomiranda/miniconda3/lib/python3.7/site-packages/xontrib/conda.xsh
no change     /Users/brandomiranda/miniconda3/etc/profile.d/conda.csh
no change     /Users/brandomiranda/.zshrc
No action taken.

but it seems it made no difference.

Any idea how to fix this?


Related resources:

See photo, ipykernel is installed

$ conda list | grep ipykernel
ipykernel          5.1.2

When you click update it spins. I could ask the user to try that again.

We have changed the way we start a kernel. We now register the current interpreter as a kernel I noticed this and was the reason I decided to submit the issue.

Our conda environment is bepoke in these ways:

  • No access to outside conda channels
  • The base environment is C:\ProgramData\CustomConda
  • PYTHONPATH, and PATH are left untouched by our conda setup

Because of these customizations I thought we might’ve found an edgecase of the new kernel loading mechanism. The thing that really bothered me is that after some time had passed, with no updates to VSCode( I checked), or the python extension, began to work for the user I was working with. It also doesn’t happen on all on my machine.

There were definitely tracebacks in the developer console…but I failed to copy them…

Is that the recommended workflow to avoid IPyKernel detection issues?

That’s the recommended workflow if anything goes wrong with Conda. If you search ‘conda’ in the python extension issues there’s lots that can go wrong with conda activation. It works out better if you activate outside of VS code and just use that.

Thanks and sorry for the ambiguity. Yes, my issue was IPyKernel not being detected but launching vscode from an activated virtual environment seems to be doing the trick. Is that the recommended workflow to avoid IPyKernel detection issues?

Why did I have to go through this if conda was working for my zsh and I am not using bash anymore

No, this isn’t a VS Code issue. Basically conda wasn’t working for you in bash and thats outside of VS Code (i.e. we dont control that behavior).

From a user’s perspective I expected it to work out of the box but it didn’t…is what Im trying to say.

Agree, however user environments are beyond the control of the extension. Hence the request to ensure the shells are configured correctly.

I totally agree, you can’t control the user’s environments. However, I am not using bash at all, so I don’t understand why my .bashrc file mattered. I guess that’s the point I was trying to make. I was using zsh. I’m pointing it out just in case it help you guys fix stuff 😃

Thanks so much for the help! 😃

@DonJayamanne @rchiodo

can you try Don’s fix here?

I can confirm that this fixes the issue.

Notifys that ipykernel is not installed

Thanks for reporting this issue. We have changed the way we start a kernel. We now register the current interpreter as a kernel. To do this we need ipykernel installed in the current interpreter. Hence you’ll need to select Yes to install ipykernel.

If you do not wish to to so, you could select another interpreter or another kernel.

Closing this issue as this is by design.

Note: The error you are getting about falling back from daemon seems to be cased by some missing file in your environment.

Please could you select Yes to installing a kernel and let us know how it goes.