在虚拟环境下使用jupyter-notbook

1,738次阅读
没有评论

1. 安装虚拟环境

这里建议使用官方自带的venv库,创建环境

python -m venv your_venv_name

2.安装ipykernel

pip install ipykernel

3.将虚拟环境添加到jupyter中

也就是创建内核:

python -m ipykernel install --user --name=your_kernel_name

卸载内核:

jupyter kernelspec uninstall your_kernel_name

4. 大功告成

启动jupyter notebook:

jupyter lab

然后在jupyter的页面,选择刚才生成的kernel,然后就可以愉快的使用虚拟环境中的包了!

参考链接:

virtualenv 的使用 —— PyCharm 与 Jupyter Notebook:https://blog.csdn.net/lanchunhui/article/details/62417398

Using Jupyter Notebook in Virtual Environment:https://www.geeksforgeeks.org/using-jupyter-notebook-in-virtual-environment/

2
西园公子
版权声明:本站原创文章,由西园公子2022-03-14发表,共计512字。
转载提示:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
载入中...