【nest入门】[bug记录]在jupyter notebook中使用conda环境(linux)

发布时间 2023-11-19 17:30:56作者: intermatrix

NEST在安装引导 https://nest-simulator.readthedocs.io/en/stable/installation/user.html#user-install 中提供了conda的方式,如下图所示:
img
如上图中步骤第1步,进行了

conda create --name nest36 -c conda-forge nest-simulator

后,在jupyter中想要切换到所创建的名为ENVNAME的conda环境。在选择jupyter notebook内核时遇到了如下情况:(并没有预想中刚刚conda create出的nest36环境)

img

于是尝试在当前环境下安装jupyter:

(nest36) root@autodl-container-c8da1195fa-a199dd0d:~# conda install jupyter

而后报错:ResolvePackageNotFound: - python=3.1
继而尝试:

(nest36) root@autodl-container-c8da1195fa-a199dd0d:~# conda install ipykernel

并执行如下代码以configure Jupyter to use Python kernel

ipython kernel install --user --name=mynest36

而后即可发现,在“选择内核”中出现了“启动其他内核”以及选项“mynest36”
img
选择mynest36作为内核后,发现import nest成功。
img