方案一:在jupyter notebook上激活时报错
1.安装nbextensions
》pip install --user jupyter_contrib_nbextensions -i https://pypi.mirrors.ustc.edu.cn/simple
2.激活
》jupyter contrib nbextension install --user
此步骤报错:jupyter contrib nbextension install --user ^ SyntaxError: invalid syntax
好傻啊,激活的命令不是在jupyter上运行,当然会报语法错误。小小的无知,折腾了一下午才搜索到解决方案
在Mac终端如iterm2输入命令:jupyter contrib nbextension install --user (1、 前提需配置好anaconda环境变量,如在~/bash_profile中设置export PATH=/Users/apple/anaconda3/bin:$pah 2、jupyter promot需要关闭状态激活)
3.安装nbextensions_configurator
》pip install --user jupyter_nbextensions_configurator
4.激活
》jupyter nbextensions_configurator enable --user
【5.注意注意:
若在jupyter中卸载,一定要加后缀 -y,不然没法实现proced(y/n?),然后就卡卡卡住了。。。
pip uninstall jupyter_contrib_nbextensions -y
pip uninstall jupyter_nbextensions_configurator -y 】
方案二:conda终端操作
1.安装 jupyter_contrib_nbextensions
法一:conda install -c conda-forge jupyter_contrib_nbextensions
【法二:
conda config --add channels conda-forge
conda install jupyter_contrib_nbextensions
conda search jupyter_contrib_nbextensions --channel conda-forge】
2. 激活 nbextensions 同上
在Mac终端如iterm2输入命令:jupyter contrib nbextension install --user
3.安装并启用 Nbextensions Configurator
conda install jupyter_nbextensions_configurator
4.激活 jupyter nbextensions_configurator enable --user
5.在终端输入命令: python3 -m IPython notebook
弹出jupyter啦,还有插件。大功告成~
借鉴博客:
https://github.com/conda-forge/jupyter_contrib_nbextensions-feedstock
https://blog.youkuaiyun.com/weixin_41425956/article/details/9044735