天天看點

在jupyter notebook中使用conda建立的虛拟環境1、進入虛拟環境xxx2、安裝ipykernel3、将虛拟環境添加至jupyter notebook4、重新開機jupyter notebook

歡迎關注我的微信公衆号“人小路遠”哦,在這裡我将會記錄自己日常學習的點滴收獲與大家分享,以後也可能會定期記錄一下自己在外讀博的所見所聞,希望大家喜歡,感謝支援! 

想要在jupyter notebook中跑conda配置的虛拟環境,那麼在虛拟環境中也需要安裝jupyter notebook對應的元件。

參考:如何在Jupyter notebook中使用virtualenv虛拟環境

1、進入虛拟環境xxx

activate xxx
           

2、安裝ipykernel

conda install ipykernel
           

3、将虛拟環境添加至jupyter notebook

xxx為虛拟環境名 ,yyy為Jupyter中要顯示的名字

python -m ipykernel install --user --name xxx--display-name yyy
           
在jupyter notebook中使用conda建立的虛拟環境1、進入虛拟環境xxx2、安裝ipykernel3、将虛拟環境添加至jupyter notebook4、重新開機jupyter notebook

4、重新開機jupyter notebook

重新開機後在标簽欄Kernel/Change kernel中即可進行切換。

在jupyter notebook中使用conda建立的虛拟環境1、進入虛拟環境xxx2、安裝ipykernel3、将虛拟環境添加至jupyter notebook4、重新開機jupyter notebook

繼續閱讀