Skip to content

TRAMP hangs after evaluating an org babel cell with jupyter-python #583

@JackHunt

Description

@JackHunt

As titled, given a notebook-esque org file as follows

#+TITLE: My Notebook
#+PROPERTY: header-args:jupyter-python :session my_session :results output :wrap example :exports both

#+begin_src jupyter-python
import os
from glob import glob

# Load some files or w.e.
#+end_src

When executing the above source block, emacs appears to hang until I C-g. The following is then found in the messages buffer

Executing Jupyter-Python code block at position 157...
Renaming MY_HOST:/tmp/tramp.rFRDE7 to /var/folders/w6/8b62vhy90rz5cvvbdt7s6tqr0000gn/T/jupyterIiwrov...done
Tramp: Opening connection jupyter-session-with-random-ports for MY_HOST using ssh...done
Tramp: Setup connection jupyter-session-with-random-ports for MY_HOST using ssh...done
Tramp: Inserting ‘/ssh:MY_HOST:/home/MY_USER/.local/share/jupyter/runtime/kernel-cfca1130-b8e0-4527-b3a2-6bc24649fa72.json’...done

If I change the language from jupyter-python to python (also losing the properties defined), then the block executes and emacs doesn't hang.

I am using Emacs 30.1 on MacOS and am remoting into a Linux machine. To ensure that all the bits I need in my remote environment are available (such as jupyter), I have forced TRAMP to use a login shell:

(setq tramp-login-shell "/bin/bash")
(setq tramp-login-args '(("-l")))

(with-eval-after-load 'tramp
  (add-to-list 'tramp-remote-path 'tramp-own-remote-path))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions