JupyterHub Terminal shows old version of Python (version 2) However, SSH terminal shows correct version

Hi,

My organization have JupyterHub 0.8.1 installed on servers. I’m facing a strange problem with wrong python version on JupyterHub notebook.

At server there are 2 python installed (v2.7.5 and v3.6.4). Whenver I type “python” on bash screen it gives me 3.6.4 version and when typed “python2” it gives out v2.7.5 which is an expected behavior.

However at JupyterHub UI level, When I am selecting Files -> New -> Terminal and typed in “python”, it gives out 2.7.5. Don’t know from where it is picking up, i have checked kernel.json file which tells version 3 as configuration so not really sure from where its picking up old version. (see snapshot below)

Can someone help me understanding this ? Thanks

Images:
At JupyterHub UI - python command shows 2.7.5
image

What does happen when you type python3? Does the right Python show up? I guess they used conda for the setup - can you confirm this? Or did they do it through tools like pip? You can see that when you start the Python interpreter because now it says something like [GCC …] in the brackets but the Anaconda version puts some own advertisement in there.

One difference I can see is that in the window below you run a shell and in the text above you mention a bash. So maybe it is about how and when environment details are loaded.

1 Like

Facing a very similar problem here (Notebook based on jupyter/all-spark-notebook docker image not picking up custom python version - Stack Overflow). Would be very interested into the solution.