From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id eONuDW88vF8xZgAA0tVLHw (envelope-from ) for ; Mon, 23 Nov 2020 22:49:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id oLBBCW88vF+qJAAAB5/wlQ (envelope-from ) for ; Mon, 23 Nov 2020 22:49:19 +0000 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 06C0394028F for ; Mon, 23 Nov 2020 22:49:17 +0000 (UTC) Received: from localhost ([::1]:43586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khKe3-0004Im-Ml for larch@yhetil.org; Mon, 23 Nov 2020 17:49:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khKcT-0004HM-88 for emacs-orgmode@gnu.org; Mon, 23 Nov 2020 17:47:39 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:34447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khKcP-0001XE-7C for emacs-orgmode@gnu.org; Mon, 23 Nov 2020 17:47:37 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 06AA71A38; Mon, 23 Nov 2020 17:47:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 23 Nov 2020 17:47:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm1; bh=9ECaeZ98J01xdaJE1EBNcjaCQI SDy+AKJl8H3puixTc=; b=tArD+JvIfpz2mRM41Vi4CZKwYf7Mp8ahFYTXRUQBQz wsRZ4+D36ZmF4fKrm5KYbQPKxx+eCQWTe+JcuzDZjxkjtBqjzzaMLq64RM+1j+ed Xt4wpCnDwgg4r/1uycIX82yGWDSuwF3PcD6jzqp4Fvzm6D0P10ELV+8ZBXHTnm4f wSypXE7lHgvA0vqgDk7VukcJUyaXNIY94yy2K7G/f/A/nEtpnOzCnf0yNjo3g46k bz0HuvF5Yc1EgfjRalSQCbNeqmFwIS2t/4YZBrPUkm0ejvcMbO/I6x3q0uVAGWwC Cz3djfbyaWgUTANtf7iVp68AgFWZdyT3LWvLuLIinnoQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=9ECaeZ 98J01xdaJE1EBNcjaCQISDy+AKJl8H3puixTc=; b=Du0nxemP8UCnj1OjdSXoiB Ps4MCVV3pq4pibM6YufUCyPuM+HmzOtSgtoyVifs63h8sCBGBKAz+TjD19NyHN/W RobMOvGDAr9i8VQuvWFFgP2NxmCL/ddFSCl2n9Qc+gJ0b2kPfb8F4ro1Fx311k80 Zmw6ASQlU8iPx/2oCQdHnuQKENJrXfgbzbCZfJMNEMILCpfkCenOwRrbc16ye1X7 SbFg7wN7Ow7bTVk5BEIWJ2dd2/jgwe8s3ii/dlWtEMUobBOCwSTqobPsvbiKVrPl OdFWKW3HU9cKEC+sLwenNLHptKDDxASeTBDNm8wvl85vL0ReWjp/GcZcI0HbTJ2w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudegjedgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufgjfffkgggtsehttdertddtredtnecuhfhrohhmpeflohhoshht ucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmqe enucggtffrrghtthgvrhhnpefhudffuefhudelhffgleeukeegudevtedtudduhfefteeu gedvvedtuddugffffeenucfkphepleehrdeltddrvddvgedrvdeffeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjohhoshhtkhhrvghmvghr shesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Received: from Swift.fastmail.com (ip5f5ae0e9.dynamic.kabel-deutschland.de [95.90.224.233]) by mail.messagingengine.com (Postfix) with ESMTPA id CED29328005D; Mon, 23 Nov 2020 17:47:28 -0500 (EST) References: <87eekkt6s9.fsf@fastmail.fm> <871rgkniyz.fsf@gmail.com> User-agent: mu4e 1.5.6; emacs 27.1.50 From: Joost Kremers To: Jack Kamm Subject: Re: ob-python: import local package into a session In-reply-to: <871rgkniyz.fsf@gmail.com> Date: Mon, 23 Nov 2020 23:47:25 +0100 Message-ID: <87mtz7r8qq.fsf@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.21; envelope-from=joostkremers@fastmail.fm; helo=wout5-smtp.messagingengine.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fastmail.fm header.s=fm1 header.b=tArD+JvI; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=Du0nxemP; dmarc=pass (policy=none) header.from=fastmail.fm; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: JiHh3jkoVh+T Hi Jack, On Mon, Nov 23 2020, Jack Kamm wrote: > This shouldn't be ob-python or even Emacs specific. You can test whether > things work by typing "python" in the terminal and attempting to import > your module. It all seems to depend on the exact directories, though, and other than modifying =sys.path= there doesn't seem to be a way to make Org, Python and me happy at the same time. :-) I wanted to create a few small, related projects that would share the utility functions, so I thought I'd put them all in separate subpackages of a single package. That works with `M-x run-python` and with an LSP server, but when I then put an Org file in its own subdirectory inside the package, I couldn't import the utils subpackage. I guess putting a =:dir= header arg might resolve that, but the Org manual says that =:dir= should not be used with =:exports both=, which I was also using. Anyway, thanks to you and to John. I think I have a better idea now how it all works and what my options are. > By the way, are you using IPython or vanilla Python? I recently > encountered an issue trying to import modules through a symlink in > IPython, whereas it worked perfectly fine in a vanilla Python session. I'm using IPython in `M-x run-python`, but vanilla Python for Org. There are no symlinks involved, so I guess it shouldn't matter. -- Joost Kremers Life has its moments