Jupyter Lab未使用虚拟环境 [英] Jupyter Lab is not using virtual environment
问题描述
我创建了一个虚拟环境,并使用pip安装了ipython[all]
和jupyter
.当我运行jupyter lab
时,打开一个笔记本,然后尝试导入在虚拟环境中安装的软件包,我会收到"ModuleNotFoundError".
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."
在控制台中运行ipython
并导入作品.另外,which jupyter
确实使我指向了虚拟环境中正确的可执行文件.
Running ipython
in the console and importing works. Also, which jupyter
does point me to the right executable in the virtual environment.
推荐答案
除了安装jupyter
外,我还需要安装jupyter lab
.否则,甚至虚拟环境jupyter
可执行文件实际上也会默默地退回到Jupyter Lab系统的安装中.
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.
这篇关于Jupyter Lab未使用虚拟环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!