0

I would like to use it with Jupyter Lab, a virtual environment created using virtualenv in the Terminal of my computer.

When I want to use the environment in the Terminal, I run workon ami, ami is the name of the environment and it works fine. I have installed some modules such as matplotlib, which I can use inside this environment.

I have tried to use this environment in Jupyter Lab. I have run

python -m ipykernel install --user --name=ami

The name ami can be selected as a kernel in the Jupyter Lab session, but the matplotlib module is not installed. It seems the ami environment created is not the same as that used in the Terminal.

I have tried to install Jupyter Lab in the ami environment, but it does not have matplotlib installed.

I would like to use the environment in Jupyter Lab without installing the Python modules that I already installed.

5
  • Possible duplicate of stackoverflow.com/questions/29900090/… ... but that's just the explanation of why it doesn't work. Is there a reason you don't simply activate your virtualenv? Commented Oct 10, 2020 at 7:10
  • @tripleee Hi, My question is different to the post linked. My virtualenv works fine. I make workon ami and the modules load is correct. For example, I can import matplotlib. However, when I start jupyter lab and use ami kernel then the modules are not there and I cannot import them. Commented Oct 10, 2020 at 8:55
  • But workon requires a shell, and you don't run a shell inside Jupyter, do you? Commented Oct 10, 2020 at 9:07
  • Possible duplicate of stackoverflow.com/questions/42449814/… though probably not the accepted answer there. Commented Oct 10, 2020 at 9:10
  • @tripleee Thank you. It does work fine if I do workon ami and then run jupyter-notebook. However, it does not work running the notebook in jupiter lab. Is there any way to use the environment in jupyter lab ?. The ami kernel I want to use is there but modules installed in the environment are not. Commented Oct 10, 2020 at 19:01

0

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.