From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GDSWHc4MPGQnTAEASxT56A (envelope-from ) for ; Sun, 16 Apr 2023 16:57:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GHF3Hc4MPGTRDAEAauVa8A (envelope-from ) for ; Sun, 16 Apr 2023 16:57:18 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2000613725 for ; Sun, 16 Apr 2023 16:57:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1po3ns-0004xf-Bb; Sun, 16 Apr 2023 10:56:32 -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 ) id 1po3nr-0004xX-Ce for emacs-orgmode@gnu.org; Sun, 16 Apr 2023 10:56:31 -0400 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1po3np-0000Wb-Ev for emacs-orgmode@gnu.org; Sun, 16 Apr 2023 10:56:31 -0400 Received: (Authenticated sender: me@fabionatali.com) by mail.gandi.net (Postfix) with ESMTPSA id DE32E240003 for ; Sun, 16 Apr 2023 14:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fabionatali.com; s=gm1; t=1681656985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=5KMqABKXIZAday16EGDF+kRYxfbQkiH/XZaE4yOqhB0=; b=enPe5Rj1mo6w4aruiY5+wHL4AHGlMq/09E2UVTwTXnRBjY1guZC5LoMZU10POIpT/gRkCw uAuY6gTEEXNjcbZC22AFdoMxunoM2KruJKmVwqoeM6f6szzgpFuDXonf8piSqU+T9+45rX jbDtfkB9R89AW4ySoBqwKd//Uch4a/H7lt/Xb9tqUy1ITlsBXMS+/Mpw3POtRS7Qc8iFJH J4zPx2H8T4lzBM98DsOgDEk0k2ty3ujsxqcCuxI3OI7x2Ke0C3zpQG5lz4M1cCnqmtQX1C 9lszPXP8Q9wEA6bgOzURHhLA+kq2GTpVDe0x3ubmVeo2WWWyI9+5cm/hByiSrw== From: Fabio Natali To: emacs-orgmode@gnu.org Subject: Command not found when using Org + Guix + envrc.el Date: Sun, 16 Apr 2023 15:56:24 +0100 Message-ID: <877cubri3r.fsf@reckondigital.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:4b98:dc4:8::221; envelope-from=me@fabionatali.com; helo=relay1-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681657038; a=rsa-sha256; cv=none; b=tny0KpmMMhsSvlSJi9EQJzVn7GRGYCNFNBtKIcmx/4zZT+//kLm5w8VRZpUC08rp89OpHj Jux6/MKuufAP2Wc8Rp4AcFxmGOe/UQlJLbKvIR1RiOyjx2YZGnrAous+b/zGCidQgg1dgp WF90b6v5pjZ2ozIBRLp0vNV1GgOdY1ypmQBFQq4BrZozGt+/9Zd7LylTz1Kw31fVqzQmUi VJjUywyTtcUPk10Ey2qcx5u1/RTDOj8GWvxbUGe6J8OKSXy/07/ksJf/50DXJMiIeVfH3N IxDHAqKmZeek2JFqvVRgFFXJgrDEY9Bxb/CTL34vQXIX0aFiMId2RAhdFHUz+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fabionatali.com header.s=gm1 header.b=enPe5Rj1; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681657038; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=5KMqABKXIZAday16EGDF+kRYxfbQkiH/XZaE4yOqhB0=; b=YbTw2vrr35tb4Tn0R0ovglQbvhM32vzY03vaVA0awkeeP9S5jXufsVKgGrnHpgeHpoY4Sn QRx8ZxhVWfx9ATi2lxP0jc9F1YX+YKpyfXLADVdAIhR3HLvUnZmpFWZCia2OKZBZzk0TFg XaNCdG7ZI2ugJH4CYIRZ1Fdsa5G0XEVT+ZotLVFneNMxbcoYKeCds2Q7oHbguuauiXRJNS 7nBMPH36znm7cHJIqo+vwpNSTo6BaEOQEEoDJH6swI5ASaNeRXioINH2kSmy21vjncjdFf gqbuYGzfhQRo1mOF+NmzThwSBdDHehnIM5T00HfhJS6vRC6+u8ekfa6tRKwwFg== X-Migadu-Queue-Id: 2000613725 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fabionatali.com header.s=gm1 header.b=enPe5Rj1; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -7.31 X-Spam-Score: -7.31 X-TUID: UKvsfH/eFYaL Hi! I tend to set up my literate programming projects with: - Emacs and Org - Guix, to install the dependencies and create a development environment - direnv, to automatically load the Guix environment - envrc.el, to use direnv from Emacs It's a great setup and I'm very grateful to the above projects, but there are a few corner cases where things don't work as expected. For instance: - Define a Guix environment that includes Python (Python not being installed on the system otherwise) - Create an envrc file that activates the Guix environment, e.g. via ~eval "$(guix shell --search-paths --manifest="$1")~ - In the same folder, create an Org file with a Python block The block is evaluated correctly when a new Emacs instance is launched from within the folder, and therefore from within the activated environment. However, things don't work as expected when using emacsclient with an existing Emacs server. Thanks to envrc.el the Guix environment gets apparently activated in the buffer, as confirmed by the envrc flag in the modeline and by the output of =(getenv "PATH")=. However, evaluating the block results in the following error: #+begin_quote /bin/bash: line 1: python: command not found [ Babel evaluation exited with code 127 ] #+end_quote Tangentially, if the block's header includes =:session=, as in =#+begin_src python :session=, then the error is slightly different and is displayed in the minibuffer as opposed to a separate buffer: #+begin_quote make-process--with-editor-process-filter: Searching for program: No such file or directory, python #+end_quote Things work fine when manually setting =org-babel-python-command=, but hardcoding the Guix store path is clearly inconvenient, to start with it'd require constant update. #+begin_quote (setq-local org-babel-python-command "/gnu/store/...") #+end_quote Does anyone have any idea on how to investigate this further? I'm still unsure whether this may have to do with envrc.el, Org Babel, or possibly with some quirks in my configuration. Thanks, cheers, Fabio.