pass extra sys.path to jupyter kernel through command line

22 views
Skip to first unread message

julien.s...@gmail.com

unread,
Jan 30, 2017, 9:16:20 AM1/30/17
to Project Jupyter
Hello list,

I'm looking for a way to add an extra module search path to a kernel through it's command line.

I know we can pass these kinds of arguments, for example:
--InlineBackend.figure_formats={"png", "pdf"}
But I did not find one that could affect the kernel sys.path to circumvent an ImportError.

For info, I would like to use the nbsphinx_execute_arguments option of nbsphinx to add a path to a generated module ;
this module's sys.path can be added to sphinx's conf.py but unfortunately this is not taken into account when nbsphinx runs the kernel to execute the cells.

j

Thomas Kluyver

unread,
Jan 30, 2017, 9:36:40 AM1/30/17
to Project Jupyter
On 30 January 2017 at 14:16, <julien.s...@gmail.com> wrote:
I'm looking for a way to add an extra module search path to a kernel through it's command line.

I don't think there's a command line option, but you can do it with the PYTHONPATH environment variable:
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH
Reply all
Reply to author
Forward
0 new messages