懒人请直接使用下面代码先更新conda,即可。
conda update --force conda
有兴趣看下面求索过程👇👇👇
为了图方便,想使用conda install nb_conda来让jupyter notebook或jupyter lab自动生成对应所有虚拟环境的Kernal。
conda install nb_conda
不料,懒人没做成,安装失败,最末尾显示:
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: failed
RemoveError: 'requests' is a dependency of conda and cannot be removed from
conda's operating environment.
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.
意思是无法删除一些库,这个时候其实用下面这个方法可以绕开这个问题:在每个虚拟环境中依次执行:
conda install ipykernel
python -m ipykernel install --name my(在文件夹里的名称) --display-name my(想在jupyter显示名称)
这样就添加了核,在C:\ProgramData\jupyter\kernels(具体看添加核时的说明)路径下其实可以看到你添加的所有核的细节。
但是我没懒成还是不服!继续解决RemoveError的问题,直到找到了

本文详细记录了解决Anaconda更新错误及在Jupyter中为多个虚拟环境添加Kernel的过程。通过使用conda update --force conda强制更新,解决了RemoveError问题,并介绍了如何在每个虚拟环境中安装ipykernel并添加Kernel。

1063

被折叠的 条评论
为什么被折叠?



