GNU bug report logs - #64990
jupyter kernels install kernel.json without GUIX_PYTHONPATH

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Ricardo Wurmus <rekado@HIDDEN>; dated Tue, 1 Aug 2023 12:15:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at submit <at>

Received: (at submit) by; 1 Aug 2023 12:14:26 +0000
From debbugs-submit-bounces <at> Tue Aug 01 08:14:26 2023
Received: from localhost ([]:47365
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1qQoGg-000054-1f
	for submit <at>; Tue, 01 Aug 2023 08:14:26 -0400
Received: from ([2001:470:142::17]:45600)
 by with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1qQoGe-00004s-NF
 for submit <at>; Tue, 01 Aug 2023 08:14:25 -0400
Received: from ([2001:470:142:3::10])
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rekado@HIDDEN>)
 id 1qQoGZ-0004yt-8h
 for bug-guix@HIDDEN; Tue, 01 Aug 2023 08:14:19 -0400
Received: from ([])
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rekado@HIDDEN>)
 id 1qQoGW-0003nl-Kc
 for bug-guix@HIDDEN; Tue, 01 Aug 2023 08:14:19 -0400
ARC-Seal: i=1; a=rsa-sha256; t=1690892051; cv=none;; s=zohoarc; 
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;;
 s=zohoarc; t=1690892051;
ARC-Authentication-Results: i=1;;
 spf=pass  smtp.mailfrom=rekado@HIDDEN;
 dmarc=pass header.from=<rekado@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690892051; 
 s=zoho;; i=rekado@HIDDEN;
Received: from localhost ( []) by
 with SMTPS id 1690892049698642.0408658091195;
 Tue, 1 Aug 2023 05:14:09 -0700 (PDT)
User-agent: mu4e 1.10.5; emacs 28.2
From: Ricardo Wurmus <rekado@HIDDEN>
To: bug-guix@HIDDEN
Subject: jupyter kernels install kernel.json without GUIX_PYTHONPATH
Date: Tue, 01 Aug 2023 13:38:42 +0200
X-Debbugs-Cc: dan.munteanu@HIDDEN
Message-ID: <87v8dz7yep.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-ZohoMailClient: External
Received-SPF: pass client-ip=; envelope-from=rekado@HIDDEN;
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -0.0 (/)

Consider this scenario: a number of users access a shared jupyterhub /
jupyterlab installation, which allows them to launch their own jupyter
kernels.  The shared installation was deployed with Guix.  The user
kernels are installed like this:

    $ guix shell python python-ipykernel python-foo python-bar =E2=80=A6
    $ [env] python3 -m ipykernel install --user --name whatever --display-n=
ame whatever
    Installed kernelspec whatever in /home/rekado/.local/share/jupyter/kern=

The installed kernel.json looks like this:

--8<---------------cut here---------------start------------->8---
 "argv": [
 "display_name": "whatever",
 "language": "python",
 "metadata": {
  "debugger": true
--8<---------------cut here---------------end--------------->8---

That=E2=80=99s not sufficient because the =E2=80=9Cipykernel_launcher=E2=80=
=9D module is
provided by the python-ipykernel package and the shared jupyter{hub,lab}
doesn=E2=80=99t know about this package.  That=E2=80=99s because it doesn=
=E2=80=99t use the
GUIX_PYTHONPATH of the profile containing the user=E2=80=99s packages.

Perhaps we could add a profile hook that adds an =E2=80=9Cenv=E2=80=9D fiel=
d to the
generated kernel.json file, which augments the existing GUIX_PYTHONPATH
with the appropriate value for the current profile.

We can do this on the command line like this:

--8<---------------cut here---------------start------------->8---
  python3 -m ipykernel install \
    --user --name whatever --display-name whatever \
--8<---------------cut here---------------end--------------->8---

Or we can edit the JSON directly.

The documentation of the kernel.json format is available here:


Acknowledgement sent to Ricardo Wurmus <rekado@HIDDEN>:
New bug report received and forwarded. Copy sent to dan.munteanu@HIDDEN, bug-guix@HIDDEN. Full text available.
Report forwarded to dan.munteanu@HIDDEN, bug-guix@HIDDEN:
bug#64990; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 1 Aug 2023 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.