conda安装新环境

1. 安装python新环境(conda create --name 环境名称 python=版本号):
conda create --name xupeng36 python=3.6

# To activate this environment, use:
# > source activate xupeng36
#
# To deactivate an active environment, use:
# > source deactivate


2. 安装库:
2.0)进入镜像
source activate xupeng36

2.1)添加镜像
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 --set show_channel_urls yes

2.2)开始安装
conda install numpy
conda install matplotlib
conda install pytorch
conda install Pillow
conda install scipy 
conda install scikit-learn


3. 配置jupyter notebook
参考:
https://blog.csdn.net/u011606714/article/details/77741324
https://stackoverflow.com/questions/37085665/in-which-conda-environment-is-jupyter-executing
3.1)安装
conda install ipykernel

3.2)首先激活对应的conda环境(source activate 环境名称)
source activate xupeng36

3.3)将环境写入notebook的kernel中(python -m ipykernel install --user --name 环境名称 --display-name "Python (环境名称)")
python -m ipykernel install --user --name xupeng36 --display-name "Python36"

3.4)然后打开notebook
jupyter notebook

3.5)浏览器打开对应地址,新建python,就会有对应的环境提示了

ref:
https://www.jianshu.com/p/5e21a225ad83?from=groupmessage
https://blog.csdn.net/lyy14011305/article/details/59500819

你可能感兴趣的:(安装教程)