9> conda 常用命令
① 创建虚拟环境
conda create -n env_name python=x.x
② 激活或者切换虚拟环境
conda activate env_name
③ 虚拟环境中安装额外的包
conda install -n env_name [package]
④ 关闭虚拟环境
conda deactivate env_name
⑤ 删除虚拟环境
conda remove -n env_name --all
⑥ 设置国内镜像
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/conda-forge/
conda config --remove-key channels # 恢复默认源
⑦ jupyter 虚拟环境
conda activate env_name # 激活命令环境
conda install ipykernel # 安装ipykernel
python -m ipykernel install --name env_name # 添加名为env_name的环境虚拟环境
jupyter kernelspec remove env_name # 移除名为env_name的环境虚拟环境
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END