【发布时间】:2020-12-18 15:10:47
【问题描述】:
我在/opt/anaconda3 的实验室工作站中为多个用户设置了 anaconda3,这样其他用户就不必为自己设置全新的 anaconda3 安装。
然后我创建了一个名为zud 的环境供我使用。所以目前,工作站有如下两种环境。
(base) zuddler@silp252-dl360:~$ conda env list
# conda environments:
#
zud /home/zuddler/.conda/envs/zud
base * /opt/anaconda3
当我使用conda activate zud 激活我的环境时,jupyter 和 ipython 没有采用正确的路径,因此我无法在我的环境中使用手动安装的库,例如,在我的环境中zud 我使用conda install -c conda-forge python-igraph 安装了python-igraph,但无法通过jupyter notebook 或ipython 访问它;他们给ModuleNotFoundError。
请在下面的base 和zud 环境中查看which 命令的结果。
对于base:
(base) zuddler@silp252-dl360:~$ which python
/opt/anaconda3/bin/python
(base) zuddler@silp252-dl360:~$ which jupyter
/opt/anaconda3/bin/jupyter
(base) zuddler@silp252-dl360:~$ which ipython
/opt/anaconda3/bin/ipython
(base) zuddler@silp252-dl360:~$ which conda
/opt/anaconda3/bin/conda
对于zud:
(zud) zuddler@silp252-dl360:~$ which python
/home/zuddler/.conda/envs/zud/bin/python
(zud) zuddler@silp252-dl360:~$ which jupyter
/opt/anaconda3/bin/jupyter
(zud) zuddler@silp252-dl360:~$ which ipython
/opt/anaconda3/bin/ipython
(zud) zuddler@silp252-dl360:~$ which conda
/opt/anaconda3/condabin/conda
根据以上结果,我假设在激活zud 时,jupyter notebook 和 ipython 没有走正确的路径。
请建议这里发生了什么以及如何解决它。
如果需要任何进一步的细节,也请告诉我,以便我可以相应地更新我的问题。
此外,如果我的问题在某处得到解答,请让我知道链接,因为我无法找到它的解决方案。
【问题讨论】:
标签: python jupyter-notebook anaconda ipython virtual-environment