jupyter notebook自动补全

jupyter 7 及以上版本不支持Nbextensions插件了,要想使用Nbextensions插件需要安装notebook6.x版本。

python目前最新的版本是3.12,notebook经典版本最新的版本号为6.5.6,但是这个版本目前支持的python最新版本为3.11.6。

安装notebook6.5.6

所以要想使用Nbextensions自动补全,首先应该下载python3.11.6版本,然后使用一下命令完成安装

# 安装note book6.5.6
pip3 install notebook==6.5.6

# 安装 nbextensions
pip3 install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

# 安装 nbextensions_configurator
pip3 install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user

卸载jupyter

如果你安装了jupyter7,首先需要完全卸载掉jupyter7

pip3 uninstall jupyter #无法卸载完
pip3 uninstall -y jupyter
pip3 uninstall -y jupyter_core
pip3 uninstall -y jupyter-client
pip3 uninstall -y jupyter-console
pip3 uninstall -y notebook
pip3 uninstall -y qtconsole
pip3 uninstall -y nbconvert
pip3 uninstall -y nbformat

卸载python

如果安装了高于3.11.6的python版本,也需要完全卸载掉。

1.查看当前 Python 版本

python -v

2.删除Python 3.12 框架,打开终端,输入

sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.12
  1. 删除 Python 3.12 应用目录
cd /Applications

sudo rm -rf Python 3.12
  1. 删除/usr/local/bin 目录下指向的Python3.12 的连接
cd /usr/local/bin/

ls -l /usr/local/bin

使用Finder 进入/usr/local/bin,删除Python3.12相关的文件
  1. 删除 Python的环境路径
vim ~/.bash_profile # 删除Python3.7设置的环境路径