我之前Jupyter notebook中只有Python3,可以通过一下方式添加python2:
python2 -m pip install ipykernel
python2 -m ipykernel install --user
python2是你的系统上对应的python2的命令,我的python2的命令是python,故对应的命令是:
python -m pip install ipykernel
python -m ipykernel install --user
与之对应,若之前Jupyter notebook中有Python2,要添加python3:
python3 -m pip install ipykernel
python3 -m ipykernel install --user