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.

C# kernel does not work at Jupyterlab/Notebook

See original GitHub issue

Describe the bug

Please complete the following:

FROM jupyter/datascience-notebook:lab-3.5.0

USER root

# Install dotnet 6 sdk & runtime
RUN apt-get update && apt-get install -y dotnet6 && \
    apt-get clean && apt-get autoclean && apt-get autoremove --purge -y && rm -rf /var/lib/apt/lists/*

# Install .NET Interactive to support C# in Jupyter notebooks
ENV PATH="$PATH:/home/jovyan/.dotnet/tools"

USER 1000

RUN dotnet tool install -g --no-cache --version 1.0.350406 --add-source "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" Microsoft.dotnet-interactive && \
     dotnet interactive jupyter install
  • docker build -t testjupyter - < Dockerfile

  • docker run -it -p 8888:8888 testjupyter start.sh "jupyter" "lab" "--log-level=DEBUG"

  • OS

    • Windows 11
    • Windows 10
    • macOS
    • Linux (Please specify distro)
    • iOS
    • Android
  • Browser

    • Chrome
    • Edge
    • Firefox
    • Safari
  • Frontend

    • Jupyter Notebook
    • Jupyter Lab
    • nteract
    • Visual Studio Code
    • Visual Studio Code Insiders
    • Visual Studio
    • Other (please specify)

Screenshots

image

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
yigitlcommented, Jan 26, 2023

I think I have the exactly the same issue but I’m not using a docker setup, I have my own VM. I am using TLJH if that is relevant. Is there a workaround for this?

  • I can run notebooks with python kernel.
  • When I open a notebook with F#-kernel, it says kernel starting, please wait... for a while, but it doesn’t start. It fails with A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration. after few minutes, and Not Connected after that.
Further information if needed:

dotnet --info

.NET SDK:
 Version:   7.0.102
 Commit:    4bbdd14480

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  20.04
 OS Platform: Linux
 RID:         ubuntu.20.04-x64
 Base Path:   /usr/share/dotnet/sdk/7.0.102/

Host:
  Version:      7.0.2
  Architecture: x64
  Commit:       d037e070eb

.NET SDKs installed:
  7.0.102 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

dotnet-interactive --version

1.0.360602+9bf026dabac44a6256a65168fa93dcb7e2edcca4

python3 --version

Python 3.9.7

jupyter --version

IPython          : 8.8.0
ipykernel        : 6.20.2
ipywidgets       : 7.7.2
jupyter_client   : 7.4.9
jupyter_core     : 5.1.5
jupyter_server   : 1.23.5
jupyterlab       : 3.5.3
nbclient         : 0.7.2
nbconvert        : 7.2.9
nbformat         : 5.7.3
notebook         : 6.5.2
qtconsole        : 5.4.0
traitlets        : 5.8.1

0reactions
bpazocommented, Jun 25, 2023

This happens currently because the expected HTTP port is not being opened in your Docker setup. (The need for this port will be removed in an upcoming update to .NET Interactive.)

What is the expected port number that needs to be opened?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Notebook - Cannot Connect to Kernel
I had a similar issue using jupyter-lab. It would not connect to a kernel containing a virtual environment with python 3.9. What worked...
Read more >
How to Fix Kernel Error in Jupyter Notebook
A kernel error occurs basically when you try opening a python 3 file in the wrong directory. The truth is Jupyter and Python...
Read more >
What to do when things go wrong — Jupyter Notebook 7.0.2 ...
Jupyter can't start a kernel​​ If your problem is with another kernel, not the Python one we maintain, you may need to look...
Read more >
Kernel failed using ROOT C++ in jupyter notebook
Hi Experts, I have newly updated my ubuntu os to 21.04 (Xorg), I am struggling using c++ in the notebook. The kernel is...
Read more >
How to fix Kernel Error or broken Python in Jupyter Notebook
It also solves the problem of running pip install but Python packages ... you might get a Kernel Error when trying to use...
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