- 创建并激活环境
conda create -n myenv
conda activate myenv
- 配置ipykernel
conda install ipykernel
python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
- 启动jupyter notebook
jupyter notebook
然后选择相应的kernel即可。
是否配置成功可以在jupyter notebook脚本中检查
import sys
print(sys.executable)
Ref:
https://medium.com/@nrk25693/how-to-add-your-conda-environment-to-your-jupyter-notebook-in-just-4-steps-abeab8b8d084
https://stackoverflow.com/questions/39604271/conda-environments-not-showing-up-in-jupyter-notebook