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?

2
  • It appears that you changed conda environment to the new one only after installing jupyter in the default / previous environment. This might be just a typo in the question though. Commented Nov 9, 2018 at 20:54
  • @krassowski thanks! fixed Commented Nov 9, 2018 at 23:19

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.