jupyter notebook更换虚拟环境(内核)

jupyter notebook更换虚拟环境(内核)

  1. 创建一个新的虚拟环境

    # stk_env 虚拟环境的名字,任取。
    conda create -n stkenv python=3.9
    
  2. 激活虚拟环境

    conda activate stkenv
    
  3. 安装ipykernel

    # 为该虚拟环境,安装内核。
    conda install -c anaconda ipykernel
    
  4. 将ipykernel改为自己环境的名字

    # jupyter notebook切换内核的时候好区分
    python -m ipykernel install --user --name=stk_env
    
  5. 重启jupyter notebook,更换虚拟环境(内核)。

    jupyter notebook更换虚拟环境(内核)_第1张图片

你可能感兴趣的:(python,jupyter,python,conda)