jupyterlab not honouring PYTHONPATH env var

1,043 views
Skip to first unread message

Robert Muil

unread,
May 17, 2018, 5:12:57 PM5/17/18
to Project Jupyter
Dear all,

version 0.32.1 of JupyterLab does not seem to honour the `PYTHONPATH` env var if it is set upon launch of the lab.
Instead, the current directory of the file browser is inserted into `sys.path`...
Is there a way around this that doesn't require hardcoding the directory into a startup script or the notebook itself?
Thank you most kindly.
Rob.

Roland Weber

unread,
May 22, 2018, 7:23:15 AM5/22/18
to Project Jupyter
Hello Rob,

have a look at these discussions, maybe there's something that works for you:

cheers,
  Roland

Robert Muil

unread,
May 24, 2018, 11:31:22 AM5/24/18
to Project Jupyter
Hi Roland,
thanks for response! I did indeed see those, but there suggestions are pretty heavy-handed and involve changing the notebooks and hard-coding paths. Usually the interpreter would honour the environment variable `PYTHONPATH` if it exists... Is there a reason for this?

It's also made more difficult that the path can't be influenced by launching jupyterlab in a different directory: it is the current directory of the file browser that is used.

Rob.

Paddy Harrison

unread,
May 31, 2018, 11:06:27 AM5/31/18
to Project Jupyter
Hi, 

I had the same problem, downgrading to JupyterLab 0.32.0 didn't help either. I found that JupyterLab would honour PYTHONPATH (set in my ~/.bash_profile) when initiated from terminal (jupyter lab). However PYTHONPATH would not be honoured when initiated from the Anaconda Navigator. Maybe you are having a similar problem, and it appears to be a problem with Anaconda for me.

NB. the Jupyter Notebooks don't have this problem. And when they are initiated a terminal instance is opened. This is not the case when Lab is initiated from the Anaconda Navigator- no terminal instance is opened.

Cheers,
Paddy

Robert Muil

unread,
May 31, 2018, 12:18:47 PM5/31/18
to jup...@googlegroups.com
Thanks Paddy, nice to hear I'm not the only one! I'm actually launching this from terminal rather than through anaconda... So I'm surprised it works for you..

--
Robert Muil
+44 7 39806 3940

--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/wFo4Aw77Omk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/0bd6ccca-2362-42c2-80b1-b107367adbdf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages