Interrupting Remote Python Kernels in Spyder or Other IDEs - python

I'm currently using Spyder to connect to a remote kernel, and I'm looking for a way to interrupt the kernel from Spyder. I found a post on Stack Overflow (Shutting down a remote kernel from Spyder) from 2020 (and 2021 in the comments) where a maintainer said that interrupting a remote kernel from Spyder is not feasible.
However, I'm wondering if other IDEs support interrupting a remote kernel. If you have any information about whether this is possible in other IDEs, I would appreciate any guidance on this topic.

Related

Working & debugging remotely with VS code & jupyter notebook

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.

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.

Add Remote option not shown in PyCharm

I am trying to set up a remote debugger with PyCharm on a Vagrant Machine.
I am following this PyCharm tutorial. However, the Add Remote option is not available for me. Just Add local and Create VirtualEnv.
Any idea why is this happening?
Just as a guess: are you using the free community edition of PyCharm? Unfortunately remote interpreters and remote debugging are only supported by the professional edition. You might take a look into the editions comparison on their website.
If you are using the pro version, we might have to dig a little deeper.
Not sure what host system you are using but if you don't mind a bit of delay, I was able to use Xforwarding over ssh and I pulled pycharm down from my remote system. (ssh -X) Pycharm detected it and gave a warning that it's updates are slowed but it worked.

atom.io, hydrogen and ipython remote (ssh) kernel

So I discovered lately this atom.io text editor. Soon after the amazing hydrogen. So far so good, hydrogen starts an ipython kernel if it isn't already running and then it gives you real time interaction, just like with ipython notebook.
Good, but does anyone know if it's possible for hydrogen to be set up to work with a remote ipython kernel? The way I thought I could make this work is to have a local kernel be a communication layer between hydrogen and the remote kernel, but I don't see any way to do this. Do you have any idea how to set this up?
Hydrogen is able to connect to remote kernels running locally or on a server since version 0.12.
Checkout our documentation for more infos.

How to run a Python script remotely

We run many Python scripts for data processing tasks. We have a modeling computer that has been upgraded to provide the best performance for these tasks, but it is shared by many people that all need to run different scripts on it at the same time.
Is it possible for me to run a Python script remotely on that machine from my laptop while others are either directly logged into it or also remotely running a script?
Is SSH a possibility? I haven't ever run any scripts remotely aside from logging in via remote desktop. Ideally, I could start the Python script on that remote machine, but all the messages would be visible to me on my laptop. Does this sound doable?
EDIT:
I forgot to mention all machines are running Windows 7.
SSH is definitely the way to go and also have a look at Fabric.
Regarding your edit. You can use Fabric on Windows. And I think that using SSH on Windows will be a bit easier than dancing with their Powershell's remoting capabilities.
SSH does seem like it should meet your needs.
You could also consider setting up an iPython notebook server that everyone could use.
Its got nice parallel processing capabilities if you are doing some serious number crunching.

Categories