I'm encountering problems while trying to reproduce a conda environment in a jupyter notebook kernel.
I've created a conda environment, mlflow
, and by activating it, I can import mlflow, as you can see below:
[ 12:36:18 ] ~ base ❯ conda activate mlflow
[ 12:36:21 ] ~ mlflow ❯ python
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mlflow
>>>
Then I proceed to install the kernel in jupyter, as:
python -m ipykernel install --name mlflow
However, once in the mlflow
kernel in jupyter, I cannot import the same module, mlflow
. Why could that be? It suspect that the issue is that C:\Users\userx\AppData\Roaming\jupyter\kernels\mlflow\kernel.json
is pointing to the wrong python:
{
"argv": [
"C:\\Users\\userx\\Anaconda3\\python.exe",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "mlflow",
"language": "python"
}
Whereas it should be pointing to the python in the mlflow
environment. However, I tried to change it and the caused the notebook to fail when launching.
More details:
[ 12:39:27 ] ~ base ❯ jupyter --path
config:
C:\Users\userx\.jupyter
C:\Users\userx\Anaconda3\etc\jupyter
C:\ProgramData\jupyter
data:
C:\Users\userx\AppData\Roaming\jupyter
C:\Users\userx\Anaconda3\share\jupyter
C:\ProgramData\jupyter
runtime:
C:\Users\userx\AppData\Roaming\jupyter\runtime
EDIT
It seems to work if I install jupyter in the environment, and launch a notebook from the environment. However, it'd still be nice to know how to do the same using the jupyter in base
.