Mac中设置默认从anaconda路径打开jupyter notebook

背景:近期update了anaconda的所有包,并设置了多个虚拟环境。

问题:启动terminal后,输入“jupyter notebook”无法打开jupyter,如下:

$ jupyter notebook
-bash: jupyter: command not found

1,临时解决方案:

(激活conda的base环境,下方路径是anaconda的安装路径)

$ source ~/anaconda3/bin/activate
(base) ccm ~

再输入“jupyter notebook”,就可以打开jupyter notebook界面了

2,终极解决方案:

(设置打开terminal默认进入base环境:在terminal中输入以下代码,并重启terminal)

$ conda config --set auto_activate_base true

之后每次打开terminal,默认进入conda的base环境,直接输入“jupyter notebook”,就可以打开jupyter notebook界面了

如果你的问题解决了,欢迎收藏+点赞+关注哦~

猜你喜欢

转载自blog.csdn.net/weixin_45281949/article/details/107012773