Commit 669abe5e authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

Really search for 'ipython' in $PATH.

Previously we assumed $PATH contained a single entry.

* guix-kernel/jupyter-server.scm (search-path->list): New procedure.
(exec-kernel): Use it along with 'search-path' to determine the absolute
file name of 'ipython'.
parent f3e3911d
;;; Guix-kernel -- Guix kernel for Jupyter
;;; Copyright (C) 2018 Pierre-Antoine Rouby <>
;;; Copyright (C) 2018 Pierre-Antoine Rouby <>
;;; Copyright (C) 2018 Ludovic Courtès <>
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
......@@ -20,6 +21,7 @@
(define-module (guix-kernel jupyter-server)
#:use-module (guix build utils)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 match)
#:use-module (simple-zmq)
#:use-module (json)
#:export (find-kernel-by-name
......@@ -108,6 +110,13 @@
(close file)
(subsitute-conn-file argv)))
(define search-path->list
(let ((not-colon (char-set-complement (char-set #\:))))
(#f '())
((? string? str)
(string-tokenize str not-colon)))))
(define (exec-kernel name conn-file)
(define (execk argv)
(let ((pid (primitive-fork)))
......@@ -118,9 +127,11 @@
(define (get-argv)
((equal? name "ipython")
(let ((argv (list (string-append (getenv "PATH") "/" name)
"kernel" "--quiet" "-f" conn-file)))
;; IPython does not provide a 'kernel.json' file like other kernels
;; do; instead, we need to execute 'ipython' from $PATH.
(let ((ipython (search-path (search-path->list (getenv "PATH"))
(list ipython "kernel" "--quiet" "-f" conn-file)))
(let ((argv (get-argv-from-file name
(find-kernel-by-name name)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment