From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 wL+iBbQgPWSwWgAASxT56A (envelope-from ) for ; Mon, 17 Apr 2023 12:34:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AE/ABLQgPWTqKAEAG6o9tA (envelope-from ) for ; Mon, 17 Apr 2023 12:34:28 +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 86470A853 for ; Mon, 17 Apr 2023 12:34:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poMAw-0006ZP-Nm; Mon, 17 Apr 2023 06:33:36 -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 1poMAo-0006ZF-Iq for emacs-orgmode@gnu.org; Mon, 17 Apr 2023 06:33:26 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poMAk-0000Do-S9 for emacs-orgmode@gnu.org; Mon, 17 Apr 2023 06:33:26 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0C534240119 for ; Mon, 17 Apr 2023 12:33:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681727600; bh=PjeNcYksAMNH5c+lKXKB5j/d0JyJVek/r2bcClH3oDo=; h=From:To:Cc:Subject:Date:From; b=T499siENAWKAjZgqn0ZNGpk1oD+TrR9kmIeSNEWR/FwHs4FRVmUqn9oE4ElRnGAMa 7H49YoXeoa/dxqMBz2X0URkUf1VI5utvr/UHst4IiXTITFjD0t3pPF54RB8hrzP5Ub 78H/H4o1UFoHU6+yHNrjCfNWYITWQCfgZqeGhpYvV5i3lwT9QLcTt/oq+nop/jcm3W r/eC1xYQxwWKvB4tjNS/ab//HvoPjx2TX3Qk5skY7qEgOAc7vHxZdRBc0pRcW7SeJo E8Rdl9+DpbZrmzRC1t+008IWxXdGX6zx2vUtScwmRNlZqy8tpLU6VX0fzZrYgwdPq3 oDuNLev/9P5+Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q0NgL2QFcz6tys; Mon, 17 Apr 2023 12:33:18 +0200 (CEST) From: Ihor Radchenko To: Fabio Natali Cc: emacs-orgmode@gnu.org Subject: Re: Command not found when using Org + Guix + envrc.el In-Reply-To: <877cubri3r.fsf@reckondigital.com> References: <877cubri3r.fsf@reckondigital.com> Date: Mon, 17 Apr 2023 10:35:50 +0000 Message-ID: <871qkin6d5.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-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-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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681727667; a=rsa-sha256; cv=none; b=sn3zO1stLmBS+h8vIVRvomcnj1Da75OIdKM1WpT6Yoic54hHpgPtRJuu/A05fuGwQMDWsR KmeBNFO7ASKIVSYX0b9bDgJ+4X4VV9tJFOeGZLclgt6MaD6zWMTjxkqiR1Wfhf8dWvvHqa oWa7r0T6+1u7XC9vtRtsLUrwAWxvZoLu3U7b+ALGVcsChoJkkaVwUNLfc+6z3wcJH28DOp 4rRqgZPXaW9Vpz5gC4uLDON3L2IG2qt8ajPh8FM3EDfrb+35diYc/lyQFtet8YBnoSqE7N VFGH/L8zMZMvapQcBMjRyosOij+NkU6GLjf6Lc5uAJntA/3dbaiFQW/jOI6c1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=T499siEN; 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=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681727667; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mUlmw5KI2ydL9VIq+tkGEQvAsjP2Xx3LVKxfoUKw7O8=; b=oPufPBP5vmEePpAAflFijHJ9Ldkiz2RkRPorMAaBa3gkxwFjPklaSz5DgpKsJjuY103i0i uwNUd+1+ISIBkLJQuGUq8DLLaCCLyeTtTYqs9A5cYZMxp6Lec4wB4nb7w3TC51YQjhzzqQ QLsHwHyshEHbAo0fRWLNmcc/gDHyA10o9lV353ki10ylq5v7YiIgYGiOa1d4Y9EH1qODcD TNm72Fz5+vrC6VVJQOFo0UBoohzRTp0lPoyNaZ1NWZIa7NzxL7O13/mhURz8+OQZslnJ91 PEVv2+NXmGb9kHh/xj9B5RFbQfLyFUW5tJIa8tD/bD4Re76/wVJJIfvfnL6Ruw== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.20 X-Spam-Score: -6.20 X-Migadu-Queue-Id: 86470A853 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=T499siEN; 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=pass (policy=none) header.from=posteo.net X-TUID: LX32oE+1nYxz Fabio Natali writes: > - 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 > ... > 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 An ugly workaround could be using :python header argument to explicitly set the python path. Org babel uses a temporary buffer + `process-file' to evaluate code blocks with no session. The current directory is being set by let-binding `default-directory'. You can look into `org-babel-execute-src-block' (sets `default-directory') -> "(funcall cmd body params)" -> `org-babel-execute:python' -> `org-babel-python-evaluate' -> `org-babel-python-evaluate-external-process' -> `org-babel-eval' -> `org-babel--shell-command-on-region' -> `process-file' call chain and check where the envrc settings get lost. I am unsure how and why the Org's approach is not working together with envrc.el. It might be helpful to add envrc devs into the loop or debug things yourself. > 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 This looks like "with-editor" package doing something funny. Not Org. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at