I generally use Anaconda Python as my distribution but wanted to use a separate (actually Cygwin) Python for running the kubernetes-client-python which is pip installable.
Basically my Jupyter (from my Cygwin/virtualenv) is picking up the Anaconda Python for Python3 kernels which is not what I was expecting.
On the other hand if I open a Terminal from Jupyter I have the correct Python/Kubernetes in my PATH.
The short question is what would you recommend I do using virtualenv as described - or maybe you'd push me to use Anaconda/env/pip?
The longer question is what do you think is happening - see below.
Thx,
Here's what I tried.
Feeling more comfortable with virtualenv than "conda env" I installed virtualenv in my system (Cygwin) Python environment.
I activated my virtualenv, pip installing jupyter and kubernetes and verified the path to my jupyter command - it was the one in my virtualenv.
I started Jupyter, opened a notebook and was surprised that the Kubernetes module wasn't available (because it was using my Anaconda Python3 as the kernel).
I wondered if it was picking something up from ~/.local ~/.jupyter or ~/.ipython so I
sourced ~/.virtualenv/kubernetes/bin/activate
created an empty directory ~/.virtualenv/kubernetes/HOME
started Jupyter as
HOME=~/.virtualenv/kubernetes/HOME jupyter
(maybe I should set WINHOME or other, in any case .local, .jupyter, .ipython don't exist under my Windows home, only under Cygwin home)
I opened a notebook and still no Kubernetes available.
I opened a terminal and verified my PATH (to check virtualenv was active) and ran a Python script to verify Kubernetes was avaliable there.
I then ran a pstree -aps <jupyter-pid> and could see that my notebook was running under anaconda Python.