emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ob-python: import local package into a session


From: Joost Kremers
Subject: ob-python: import local package into a session
Date: Mon, 23 Nov 2020 16:46:46 +0100
User-agent: mu4e 1.5.6; emacs 27.1.50

Hi all,

If I have an Org file with Python source blocks, I can run them in a session
with the `:session` header arg. That way, I can include packages installed in
`site-packages` and have them available in all code blocks. But is there a way
to import my own packages into a session? In particular, packages I haven't
installed system-wide?

What I'm trying to do is to import a Python file with a bunch of utility
functions into the ob-python session. I thought this might be possible if I'd
structure my code as a regular Python package, because that works if I want to
import my utility functions into another Python file. But it doesn't seem to
work for the ob-python session.

Is there a way to achieve this? I don't *have* to structure my utility functions
as a Python package, so if there's another way of doing this, I'd be interested
as well.

TIA

Joost


-- 
Joost Kremers
Life has its moments



reply via email to

[Prev in Thread] Current Thread [Next in Thread]