Working & debugging remotely with VS code & jupyter notebook - python

I have recently started working with VS-Code & Python Jupyter Notebook remotely using SSH and it was great until now. Almost had the experience of working directly on the server as I was able to execute and debug the notebook cells.
As I swapped between servers (containers / VDIs with the same file system), something might have happened to the remote extensions. The debugging had stopped working. I click on the debug button for a notebook cell, but the debug toolbar does not reach the breakpoint. The step option does not appear on the debugging screen.
Any suggestions on how to analyze/solve this would be appreciated.
Thanks

Looking on the vscode various logs (I think it was the python log) I found an exception occurs when I tried to step a single line. Searching further on the network I found this:
https://github.com/microsoft/vscode-jupyter/issues/8803
In short downgrading my ipykernel package from 6.8.0 to 6.7.0 did the trick and solved my problem.

Related

Jupyter notebook in blank when initiating a notebook - remote desktop

I'm trying to run jupyter notebook on a remote desktop, which is highly secured (i.e. I had to activate scripting on internet explorer to be able to log in into outlook).
I am really new to this remote desktop thing and I would like to know why is this happening and if it has a solution. As a finance student, I really struggle with this stuff.
I used miniconda to run this. Also, this is shown in the terminal before opening the jupyter notebook window:
"[W 09:21:35.153 NotebookApp] Terminals not available (error was DLL load failed while importing winpty: The specified procedure could not be found.)"
What is shown when I open a notebook
Best regards,
I'm not sure Internet Explorer supports jupyter notebooks, try with another browser if you can.

Jupyter notebook looses connection

I am fairly new to working with python, so I am sorry if this is a naive question.
I have set up a jupyter notebook that I start through the windows terminal. I run it with python 3.9.7 in an Anaconda virtual environment. I use microsoft edge as host browser because I had problems with google chrome blocking jupyter lab.
Since yesterday, I receive an error message after opening my notebook with - jupyter lab command (which has worked for me since some weeks now). The puzzling thing is, that I can open my notebook and work in it for some minutes usually, but then this message pops up:
Server Connection Error: A connection to the Jupyter server could not be established. JupyterLab will continue trying to reconnect. Check
your network connection or Jupyter server configuration.
Unfortunately, I have really no idea why this could be, therefore I have not tried much to fix this yet. I have a stable internet connection. Simply closing the notebook and reopening it worked for some times, but after a while of working in the notebook it looses the connection again.
Has anyone experienced similar problems?
Thank you for your help and ideas!
I had this issue with jupyter lab my error seems the same:
"A connection to the Jupyter server could not be established.
JupyterLab will continue trying to reconnect. Check your network
connection or Jupyter server configuration."
The problem for me was that I had started the program from the command line using the "jupyter-lab" command and had subsequently closed my terminal after the jupyter lab opened. Closing terminal shut down the required server. Left the terminal open and is working normally.

Why IPython Console in Spyder4 updates constantly when connecting to remote kernel on server?

I followed the instructions on the official Spyder page and successfully connected to remote kernel via SSH. However I have a problem in my Ipython Console as it refreshes every 2-3 seconds adding In [1]: lines infinitely. I suppose it is refreshing of a state on server, but could someone explain what is this, why this happens and can I turn it off, so that the Console behaves the same as when I work on my local kernel(without infinite adding of empty lines)?
The solution could be found here in post of scott-8: https://github.com/spyder-ide/spyder/issues/10240#issuecomment-543913159
The copy of the answer:
Don't know about the issue above, but here is what solved my issue for anyone reading: instead of running python -m spyder_kernels.console and connecting to the kernel, quit the kernel after running it. Then restart the kernel with python -m spyder_kernels.console -f kernel-xxxxx.json, specifying the file that was just created in the runtime directory, and connect to it. This fixed my problem for some reason.

Jupyter notebook not opening from Centos 7

I have recently installed jupyter notebook on Centos 7. I have been trying to get it launched on my browser from past 2 days and have tried every answer on stack overflow. It stopped showing " No web browser found " when i type it on the command terminal. But when i copy and paste the link onto the google chrome browser it's showing, This site can't be reached.
How will i resolve this issue?
If you follow carefully the instructions on this post, you'll solve your problem.
I went through the same situation and followed these steps.
https://techknight.eu/2016/01/03/setup-jupyter-notebook-centosrhel-7/
The key is to :
Modify the configuration .py file with your desired values (specially the IP on wich the notebook will run).
Allow the port you're gonna use throug the CentOS firewall
In any case, if you break the configuration and you need a fresh start, you can always do:
jupyter notebook --generate-config
And the file will regenerate with default values.
Good Luck

Jupyter Notebook becomes unresponsive after inactivity for a while, does not log to terminal

This is a strange thing that I've noticed only for a particular computer. If I leave the Jupyter Notebook page inactive for a while (without closing the browser page or putting the computer to sleep) and come back to it, the kernel would appear to be completely unresponsive; but it wouldn't say "Kernel Dead" either. Restarting the kernel from the Jupyter Notebook does nothing so I always ended up having to close the command window from which Jupyter Notebook was run, and it goes without saying that all the variables were lost.
Whenever this happens, any activity on the Jupyter Notebook page following its "death" is not logged in the command window that runs it.
Tried searching around on GitHub which might have been a more appropriate channel with no luck.
I'd be happy to provide more info. Thanks!
This wight not be a helpful answer as it will not address the root cause of the problem but rather present a workaround. The kernel is an independent process from the browser so you can close the browser tab and reopen it (e.g http://localhost:8888/) and it connects to the still running kernel without any problems.

Categories