安装 jupyter notebook 扩展

问题环境:MacOS 10.11、Python 3.8

安装扩展命令如下:

pip install jupyter_contrib_nbextensions;
jupyter contrib nbextension install --user

当启动 jupyter notebook 时,没有发现 Nbextensions 这一标签,并在后台报错如下:

404 GET /static/notebook/js/mathjaxutils.js?v=20210104074506 (::1) 6.410000ms referer=http://localhost:9999/tree

问题是找不到 mathjaxutils.js 静态文件。

解决办法如下:

该文件在 .virtualenvs/data-analysis-env/lib/python3.8/site-packages/notebook/static/base/js/mathjaxutils.js 目录下,切换到 static/notebook/js 目录下,并创建一个指向 mathjaxutils.js 的软连接即可。

ln -s /Users/meng/.virtualenvs/data-analysis-env/lib/python3.8/site-packages/notebook/static/base/js/mathjaxutils.js mathjaxutils.js

此时,再启动 jupyter notebook 问题解决,希望对你有所帮助!

未经允许不得转载:一亩三分地 » 安装 jupyter notebook 扩展
评论 (0)

7 + 2 =