Anaconda的一些配置问题

  1. conda配置清华源镜像
    输入以下代码:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  1. jupyter notebook使用内核切换的问题
    一般执行以下代码之后可以解决:
conda install nb_conda_kernels

如果没有解决,可以试试在虚拟环境中安装jupyter或者ipython。

现在在使用vscode来编辑jupyter notebook文件,一般情况下采用下面的方法就可以自由切换了;
首先安装ipykernel:conda install ipykernel
然后运行下面的指令:

python -m ipykernel install --user --name 虚拟环境名称 --display-name "展示名称"

然后在vscode中的右上角来切换我们展示名称的那个环境就好了;

  1. 查看所有的内核
jupyter kernelspec list
  1. 删除某个内核
jupyter kernelspec remove 内核名字
原文地址:https://www.cnblogs.com/noob-l/p/14162906.html