conda安装之后使用命令行
将anaconda的bin目录加入PATH,根据版本不同,也可能是~/anaconda3/bin
echo ‘export PATH="~/anaconda2/bin:$PATH"’ >> ~/.bashrc
更新bashrc以立即生效
source ~/.bashrc
如果mac安装了zshrc怎么办,简单
修改~/.zshrc文件,在其中添加:source ~/.bash_profile、source ~/.bashrc;
相反的道理也是,也可以在bashrc里填写 source ~/.zshrc.
创建虚拟环境
conda create --name torchenv python=3.7.0
conda info -e
jupyter 捕获 conda虚拟环境
conda install nb_conda_kernels
但有时候无法完全同步好。如果无法同步好,请继续用下面的方法。
手动安装conda 虚拟环境到jupyter
source activate xx
conda install ipykernel
python -m ipykernel install --user --name xx--display-name "Python虚拟环境-xx"
实测可行。
在conda的当前虚拟环境里启动jupyter notebook
jupyter notebook
参考文献
https://hao5743.github.io/2017/06/28/2017-06-28/