1. 先運行下行⬇️代碼,看電腦中的kernel路徑,
jupyter kernelspec list
比如:
python2 /usr/local/share/jupyter/kernels/python2
pytorch37 /usr/local/share/jupyter/kernels/pytorch37
pytorch3_6 /usr/local/share/jupyter/kernels/pytorch3_6
2. 運行下行代碼,刪掉不用的kernel
比如:
rm -r /usr/local/share/jupyter/kernels/python2
按以上方式刪掉其他不用的kernel。
3. 安裝正確的kernel
python -m ipykernel install --user