X-Loop: help-debbugs@HIDDEN
Subject: bug#64990: jupyter kernels install kernel.json without GUIX_PYTHONPATH
Resent-From: Ricardo Wurmus <rekado@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: dan.munteanu@HIDDEN, bug-guix@HIDDEN
Resent-Date: Tue, 01 Aug 2023 12:15:02 +0000
Resent-Message-ID: <handler.64990.B.1690892066318 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 64990
X-GNU-PR-Package: guix
X-GNU-PR-Keywords:
To: 64990 <at> debbugs.gnu.org
Cc: dan.munteanu@HIDDEN
X-Debbugs-Original-To: bug-guix@HIDDEN
X-Debbugs-Original-Xcc: dan.munteanu@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.1690892066318
(code B ref -1); Tue, 01 Aug 2023 12:15:02 +0000
Received: (at submit) by debbugs.gnu.org; 1 Aug 2023 12:14:26 +0000
Received: from localhost ([127.0.0.1]:47365 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1qQoGg-000054-1f
for submit <at> debbugs.gnu.org; Tue, 01 Aug 2023 08:14:26 -0400
Received: from lists.gnu.org ([2001:470:142::17]:45600)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <rekado@HIDDEN>) id 1qQoGe-00004s-NF
for submit <at> debbugs.gnu.org; Tue, 01 Aug 2023 08:14:25 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists.gnu.org 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 sender3-of-o58.zoho.com ([136.143.184.58])
by eggs.gnu.org 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;
d=zohomail.com; s=zohoarc;
b=QSet9n7AIHJa3JMrYzDJ8Oet4fP2SapvMrG7Ir+PTeD25t7cxvNVU8relKahBdm3z2SkprMqxTHYhhV9Ac8jx7gZQha21wlG9u7/04yxcjVa7svRXqUvmdt2dfSpwQyi2Gl6z+uNlWz66UPrS5w31Vo3pgd5+/saTU2JUIJgj/o=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
s=zohoarc; t=1690892051;
h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To;
bh=w3ZdcMFEQot08/R5oQ/16HtxIOHjo1jT7EntKVx8l58=;
b=P6GFGpeqhoeXUx26EoSvKZmUlAHkNj0+okXb6ehqOdI0TkrA/kSJv9EYa8NoO0zsbytrT5Z+s3s5qd1u2GJWerwAtIe4maG+K0fiXigYhooHaP3ZCLDwQCiVWEGSRZGj/7oFv3pUoNBacm36c1uSIY3DocChFloEA8CoEH1Ud7M=
ARC-Authentication-Results: i=1; mx.zohomail.com;
dkim=pass header.i=elephly.net;
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; d=elephly.net; i=rekado@HIDDEN;
h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;
bh=w3ZdcMFEQot08/R5oQ/16HtxIOHjo1jT7EntKVx8l58=;
b=YOLGOy/SUjlCw9So0AIXCZICFVlRfhshhL1ahtgheScR1y+orA626Mv6z4RMrNo5
hf0bdBncrCG/jizPA1QzF/f6o6nlt+VOVXtv88lZc1eXAxixjg5LzttHXX5nRwyETra
F+xRKrHi0ilW2ttQLTRjWNZQMKNTbL0N9clJ8fVY=
Received: from localhost (141.80.222.151 [141.80.222.151]) by mx.zohomail.com
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>
Date: Tue, 01 Aug 2023 13:38:42 +0200
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=136.143.184.58; envelope-from=rekado@HIDDEN;
helo=sender3-of-o58.zoho.com
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,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,
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-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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=
els/whatever
The installed kernel.json looks like this:
--8<---------------cut here---------------start------------->8---
{
"argv": [
"/gnu/store/=E2=80=A6-profile/bin/python3",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"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 \
--env GUIX_PYTHONPATH "${GUIX_PYTHONPATH}:\${GUIX_PYTHONPATH}"
--8<---------------cut here---------------end--------------->8---
Or we can edit the JSON directly.
The documentation of the kernel.json format is available here:
https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs
--=20
Ricardo
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Ricardo Wurmus <rekado@HIDDEN> Subject: bug#64990: Acknowledgement (jupyter kernels install kernel.json without GUIX_PYTHONPATH) Message-ID: <handler.64990.B.1690892066318.ack <at> debbugs.gnu.org> References: <87v8dz7yep.fsf@HIDDEN> X-Gnu-PR-Message: ack 64990 X-Gnu-PR-Package: guix Reply-To: 64990 <at> debbugs.gnu.org Date: Tue, 01 Aug 2023 12:15:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. As you requested using X-Debbugs-CC, your message was also forwarded to dan.munteanu@HIDDEN (after having been given a bug report number, if it did not have one). Your message has been sent to the package maintainer(s): bug-guix@HIDDEN If you wish to submit further information on this problem, please send it to 64990 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 64990: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64990 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.