Jupyter Notebook激活conda环境

Windows环境配置如下:

1.打开默认conda环境:

(root) C:\Users\username>

2.选择要在Jupyter Notebook中激活的env,并激活

(root) C:\Users\username>conda env list
# conda environments:
#
flappybird               D:\ProgramData\Miniconda3\envs\flappybird
siraj-regression         D:\ProgramData\Miniconda3\envs\siraj-regression
style-transfer           D:\ProgramData\Miniconda3\envs\style-transfer
root                  *  D:\ProgramData\Miniconda3

(root) C:\Users\username>activate siraj-regression

3.在要激活的环境中安装ipykernel

<siraj-regression>C:\Users\username> conda install ipykernel

4.将选择的conda环境注入Jupyter Notebook

<siraj-regression> C:\Users\username>python -m ipykernel install --user --name siraj-regressio
n --display-name "Python [conda env:siraj-regression]"

Installed kernelspec siraj-regression in C:\Users\pactera\AppData\Roaming\jupyte
r\kernels\siraj-regression

格式: python -m ipykernel install --user --name [要设置的conda中的环境] --display-name [在Jupyter Notebook中要显示的环境变量]

5.conda root环境下打开Jupyter Notebook即可,在打开的UI界面即可看到已加载的内核。

(root) C:\Users\username>jupyter notebook

你可能感兴趣的:(Jupyter Notebook激活conda环境)