2

I created a new virtual environment:

conda create -n ml python=3.7 jupyter
activate ml

then, from command line I run jupyter lab

> jupyter lab

and from the prompt in a notebook in jupyter lab:

In  [1]: import sys
In  [2]: sys.executable
Out [2]: 'C:\\ProgramData\\Anaconda3\\python.exe'
In  [3]: !where jupyter
Out [3]: C:\Users\ragingroosevelt\AppData\Local\conda\conda\envs\ml\Scripts\jupyter.exe

Next, I start jupyter notebook (from the same command prompt window)

> jupyter notebook

and from the prompt in a notebook:

In  [1]: import sys
In  [2]: sys.executable
Out [2]: 'C:\\Users\\ragingroosevelt\\AppData\\Local\\conda\\conda\\envs\\ml\\python.exe'
In  [3]: !where jupyter
Out [3]: C:\Users\ragingroosevelt\AppData\Local\conda\conda\envs\ml\Scripts\jupyter.exe

I'm not sure what's causing the issue. I assume there's something in notebook startup scripts that lab is missing that take the virtual environment into account?

What is causing this issue? How would I got about fixing it?

RagingRoosevelt
  • 2,046
  • 19
  • 34

1 Answers1

2

I kept poking around. It appears that jupyter lab is actually an python library (jupyterlab) independent of jupyter and because I hadn't installed it in my ml virtual environment, it was using the jupyterlab install of the anaconda base virtual environment. I hadn't heard of this type of bleed-over before but that seems to be the cause of the problem.

> conda install --name ml jupyterlab

resolved the issue.

RagingRoosevelt
  • 2,046
  • 19
  • 34