conda对python的一些操作基础
(base 为在 anaconda shell 中)
查看 cond 中存在的 python 环境(带 * 的表示当前环境)
1 | conda info --env |
创建指定的 python 环境
1 | conda create --name py35 python=3.5 |
激活(进入)已经安装的指定的 python 环境
1 | conda activate py35 |
【切换到对应环境后再进行 pip 安装,即给对应的环境安装对应的包】
退出当前环境
1 | conda deactivate |
删除指定的 python 环境
1 | conda remove -n py35 --all |
更新当前 python 版本
1 | conda update python |
更新至指定版本
1 | conda install python=3.xxx |
清理 Anaconda 缓存
1 | conda clean --all |
jupyter
1 | # 安装jupyter # 这样好像会自动创建jupyter内核,且在当前环境(不确定) |
ps:
VS Code 等需要 ipykernel 这个库才能把你的虚拟环境挂载到 Jupyter 上。所以: pip install ipykernel








