Jupyter Lab is not using virtual environment

2019-05-19 17:18发布

问题:

I created a virtual environment and installed ipython[all] and jupyter with pip. When I run jupyter lab, open a notebook, and try importing a package I installed inside the virtual environment, I get “ModuleNotFoundError.”

Running ipython in the console and importing works. Also, which jupyter does point me to the right executable in the virtual environment.

回答1:

In addition to installing jupyter, I need to install jupyter lab. Otherwise, even the virtual environment jupyter executable actually silently falls back to the system Jupyter Lab installation.