jupyter notebook 添加新 kernel

所遇到问题描述: 使用本地jupyter notebook 时一直报错 no module named XXX 
总结原因: 是jupyter notebook 使用的kernel版本选择错误,尝试重新指向所需使用的python版本。
 
 
method1:直接使用指定python安装jupyter
如,要在jupyter notebook中使用python3,在terminal中执行以下即可
python3 -m pip install ipykernel
python3 -m ipykernel install --user

 

method2:
 

jupyter notebook的kernel列表中没有此python,因此,重新添加新kernel即可。

首先安装ipykernel

pip install ipykernel

 

在terminal 中键入 cd /usr/local/Cellar/python/2.7.14/bin/
                     键入 python2.7 -m ipykernel install —name python2.7
 
完成!!!( jupyter notebook中会添加一项新的python2.7,如图所示,即完成。)

 

 

 

 

另:查看jupyter notebook kernel 命令: jupyter kernelspec kernelname
       删除jupyter notebook kernel 命令: jupyter kernelspec remove kernelname

 

 

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值