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.

Issues using Julia kernel without a python/conda installatoin

See original GitHub issue

I am trying to test out usage without an existing conda installation or the the python extension installed. cc @rchiodo

Environment data

  • VS Code version: 1.53.0-insider
  • Jupyter Extension version (available under the Extensions sidebar): 2020.12.414227025
  • Python Extension version (available under the Extensions sidebar): N/A
  • OS (Windows | Mac | Linux distro) and version: WIndows 10
  • Python and/or Anaconda version: N/A
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Jupyter server running: Local

Expected behaviour

I expect to be able to create a Julia notebook without installation of conda or the python extension

Actual behaviour

It seems to ahve trouble connecting to the kernel in that case.

Steps to reproduce:

Minimal Setup: 0. Install the jupyter extension and no other extensions. Not even the Julia one, which should not be needed.

  1. Install Julia on your machine, in my case 1.5.3
  2. In the Juila REPL do an ] add IJulia in julia or a ] build IJulia if you already had it installed. This would install the kernelspec as required.

In vscode:

  1. Do a > Create New Jupyter Notebook and then > Select Notebook Kernel. to choose Julia 1.5.3. I didn’t have trouble finding it on my system.
    • The same thing happens if I open a preexsting notebook as well, I will give both logs.
  2. It seems to correctly appear in the lower right hand corner of the window.
  3. If I add in a some code and execute it, it says it is Connecting to kernel: Julia 1.5.3 which is good.
  4. But then it says “Timed out waiting to get a heartbeat from kernel process”.

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

User belongs to experiment group 'NativeNotebookEditor'
> ~\AppData\Local\Programs\Julia 1.5.3\bin\julia.exe -i --color=yes --project=@. ~\.julia\packages\IJulia\IDNmS\src\kernel.jl ~\AppData\Local\Temp\tmp-4504pUQHacw3pI8g.json
cwd: c:\Users\jlperla\Documents\GitHub\quantecon-notebooks-julia\getting_started_julia
Error 2021-01-12 10:39:12: Timed out waiting to get a heartbeat from kernel process.
Error 2021-01-12 10:39:12: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process.
Error 2021-01-12 10:39:12: failed to create INotebook in kernel [Error: Timed out waiting to get a heartbeat from kernel process.
	at m.waitForHeartbeat (c:\Users\jlperla\.vscode-insiders\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:637256)]
Error 2021-01-12 10:39:12: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
	at m.waitForHeartbeat (c:\Users\jlperla\.vscode-insiders\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:637256)]

A few things:

  • The julia executable points at, C:\users\jlperla\AppData\Local\Programs\Julia 1.5.3\bin\julia.exe But I do find the whole linux ~ thing a little fishy. But maybe that is just how you display it.

Similarly, the same sort of thing happens if I open a preexisting notebook. For example, I have one in c:\Users\jlperla\Documents\GitHub\quantecon-notebooks-julia\getting_started_julia and when I try to run a cell within the kernel I get.

User belongs to experiment group 'NativeNotebookEditor'
> ~\AppData\Local\Programs\Julia 1.5.3\bin\julia.exe -i --color=yes --project=@. ~\.julia\packages\IJulia\IDNmS\src\kernel.jl ~\AppData\Local\Temp\tmp-4504pUQHacw3pI8g.json
cwd: c:\Users\jlperla\Documents\GitHub\quantecon-notebooks-julia\getting_started_julia
Error 2021-01-12 10:39:12: Timed out waiting to get a heartbeat from kernel process.
Error 2021-01-12 10:39:12: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process.
Error 2021-01-12 10:39:12: failed to create INotebook in kernel [Error: Timed out waiting to get a heartbeat from kernel process.
	at m.waitForHeartbeat (c:\Users\jlperla\.vscode-insiders\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:637256)]
Error 2021-01-12 10:39:12: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
	at m.waitForHeartbeat (c:\Users\jlperla\.vscode-insiders\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:637256)]
> ~\AppData\Local\Programs\Julia 1.5.3\bin\julia.exe -i --color=yes --project=@. ~\.julia\packages\IJulia\IDNmS\src\kernel.jl ~\AppData\Local\Temp\tmp-4504Q9TMI8Pz57Yl.json
cwd: c:\Users\jlperla\Documents\GitHub\quantecon-notebooks-julia\getting_started_julia
Error 2021-01-12 10:44:49: Timed out waiting to get a heartbeat from kernel process.
Error 2021-01-12 10:44:49: Failed to connect raw kernel session: Error: Timed out waiting to get a heartbeat from kernel process.
Error 2021-01-12 10:44:49: failed to create INotebook in kernel [Error: Timed out waiting to get a heartbeat from kernel process.
	at m.waitForHeartbeat (c:\Users\jlperla\.vscode-insiders\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:637256)]
Error 2021-01-12 10:44:49: DataScience Error [Error: Timed out waiting to get a heartbeat from kernel process.
	at m.waitForHeartbeat (c:\Users\jlperla\.vscode-insiders\extensions\ms-toolsai.jupyter-2020.12.414227025\out\client\extension.js:49:637256)]

One thing I will point out is that if I convert over the text that it seems to be using for the kernel.jl call, i.e.

~\AppData\Local\Programs\Julia 1.5.3\bin\julia.exe -i --color=yes --project=@. ~\.julia\packages\IJulia\IDNmS\src\kernel.jl ~\AppData\Local\Temp\tmp-4504pUQHacw3pI8g.json

That is, in powershell I run

PS C:\Users\jlperla\Documents\GitHub> julia.exe -i --color=yes --project=@. $HOME\.julia\packages\IJulia\IDNmS\src\kernel.jl $HOME\AppData\Local\Temp\tmp-274403HLuz4vgGiuM.json
Starting kernel event loops.

Then it seems to be working? But I had trouble due to the space in the path name, so didn’t do the $HOME thing there.

Is it possible that this is just a path escaping problem?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jlperlacommented, Jan 19, 2021

@IanMatthewHuff All sounds great. For julia, the last LTS is the 1.05 (although they are talking about the upcoming release maybe being the new LTS) but the package system and binary distribution stuff has changed so radically since 1.0.5 that I think that testing on 1.5 or above is much more sane at this point. I am willing to bet that nobody stuck on the LTS is going to use this feature prior to a new LTS.

BTW, for testing out any changes to your user info on kernel problems, you might be able to replicate the exact issue that I saw by cloning https://github.com/QuantEcon/quantecon-notebooks-julia and then opening one of those notebooks inside of that folder (which picks up the Project.toml and Manifest.toml by going recursively up the directories). It probably will have the same problem I had, but might not. Regardless, you would need julia 1.4 or above.

0reactions
IanMatthewHuffcommented, Jan 19, 2021

@jlperla Your comment on this is very relevant. It’s actually an issue that we are working on addressing now.

The crux of the issue is that ‘timeout’ error isn’t useful to the user, and it’s more of a catch-all chokepoint for any issues with a kernel failing to start. Even in just the Python world kernels can fail to start in a myriad of ways and now that we’re starting up other language kernels directly there are more options for failing kernels here. Were talking some about better options here, but as a stopgap in our next release I believe that we’re adding a warning message in the timeout case directing users to the advanced logging option so that they can at least see the output coming in.

Regarding the Julia version I believe that I had 1.0.5 as it was listed as the LTS version on the Julia site. Does look pretty old though so I’ll look at installing the newest stable as well. I think that for our testing we’re actually using the newest stable, LTS was just what I happened to have installed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using IJulia with existing Jupyter installation outwith Anaconda
I installed Julia today and then tried to connect to my existing Jupyter installation; note that I don't have, or wish to have...
Read more >
Troubleshooting · IJulia - Julia programming language
Try running jupyter --version and make sure that it prints 3.0. 0 or larger; earlier versions of IPython are no longer supported by...
Read more >
R and Julia Kernels not available in Jupyter notebook
To install R on Anaconda(2/3) Jupyter Notebook : Open 'Anaconda Command Prompt' & execute conda update notebook to update your Jupyter notebook ...
Read more >
How to install Julia in Anaconda environment - Educative.io
It supports many programming languages such as Python, R, and most recently, Julia, to name a few. Below are the steps you need...
Read more >
Readme · IJulia.jl - JuliaHub
SCRIPTDIR in Julia to find out where Conda installed jupyter . ... is an application that lets you work with notebooks without a...
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