|
From: | Maxim Nikulin |
Subject: | Re: ob-python: import local package into a session |
Date: | Tue, 24 Nov 2020 19:23:34 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
2020-11-23 Joost Kremers wrote:
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?
I do not have a recipe ready for using with org mode, and maybe you have already tried the following instruments:
1. Besides system-wide site-packages directory, there is similar ones for users, used by e.g. `pip install` (unless it is disabled accordingly to some recommendations).
2. It seems that *recommended* and more flexible way is per-project (per-version) virtual environments: venv in python3, similar thing were called virtualenv in python2: https://docs.python.org/3/tutorial/venv.html Maybe there is a convenient way to choose and switch venv's directly from emacs. In simple cases venv could be activated before starting emacs.
3. The Hitchhiker's Guide to Python have a couple of related sections. They might be a bit outdated but could be a source for convincing arguments to use venv's or for some usage patterns.
https://docs.python-guide.org/dev/virtualenvs/ https://docs.python-guide.org/dev/pip-virtualenv/
[Prev in Thread] | Current Thread | [Next in Thread] |