I have a Python executable locally on my machine that has functionality/libraries not available for download in standard Python. I want to be able to import these libraries into JupyterLab, which I believe means changing the iPython kernel that JupyterLab is running on. It's not possible to launch Jupyter from the C:\ProgramData\
location where it is located.
My compiler/interpreter is currently in Anaconda:
import sys
print(sys.executable)
> C:\ProgramData\Anaconda3\python.exe
I want to add an iPython kernel using Python from a different source/path, currently:
C:\Program Files\IBM\SPSS\Statistics\27\Python3
This answer suggests adding a new kernel like this:
python -m ipykernel install --user --name <kernel_name> --display-name "<Name_to_display>"
but neither this answer (nor anywhere in the iPython documentation) does there seem to be an option to pull in Python from somewhere outside Anaconda in creating the new kernel. Is there a way to do this with a kernel, or a different way altogether?
My current workaround is to use %%script
like this, but that limits the functionality to one cell and means the cell isn't really operating as a typical cell in a notebook anyway:
%%script C:\Program Files\IBM\SPSS\Statistics\27\Python3
Note: This is a specific approach to a more wide-ranging question regarding SPSS external mode here.