conda create -n my-conda-env # creates new virtual env
conda activate my-conda-env # activate environment in terminal
conda install ipykernel # install Python kernel in new conda env
ipython kernel install --user --name=my-conda-env-kernel # configure Jupyter to use Python kernel
jupyter notebook # run jupyter from system
内核和 conda 环境的名称彼此独立,但使用相似的名称可能更有意义。
只有 Python 内核会在 conda 环境中运行,系统中的 Jupyter 或不同的 conda 环境将被使用——它没有安装在
conda 环境中。通过调用ipython kernel install将 jupyter 配置为使用 conda
环境作为内核,请参阅Jupyter 文档和IPython 文档以获取更多信息
参考文献:
1、https://blog.csdn.net/u014264373/article/details/119390267
2、https://stackoverflow.com/questions/58068818/how-to-use-jupyter-notebooks-in-a-conda-environment/58068850#58068850
3、https://zhuanlan.zhihu.com/p/160997771