先说下我这边的原因,jupyter notebook版本太高了,js报错找不到text/plain,回退版本可以解决问题。
总结一下尝试了的方法:
方法1(无效): 把谷歌浏览器设置成默认打开方式
https://blog.csdn.net/xavier_muse/article/details/83830394
方法2(无效):升级谷歌浏览器
https://blog.csdn.net/u012724887/article/details/81667193
方法3(无效):清除cache
https://github.com/jupyter/notebook/issues/1627
方法4(无效):用火狐浏览器
方法5(无效):关闭防火墙,
或允许ipython.exe,pythonw.exe,jupyter-notebook.exe, jupyter.exe通过Windows防火墙通信
https://blog.csdn.net/xc555/article/details/81944979
https://blog.csdn.net/weixin_41813895/article/details/81739502
方法6(有效,重点尝试):回退jupyter版本(5.7.6版本更新导致的问题)
参考:https://blog.csdn.net/qq_35531549/article/details/88594422
pip uninstall jupyter notebook
pip install jupyter notebook==5.7.4
不行的话可以退得更老一点
方法7(有效):修改源码
参考:https://github.com/jupyter/notebook/pull/4468/files
路径:Anaconda\env\你的环境\Lib\site-packages\notebook\notebookapp.py
修改def init_mime_overrides(self):
def init_mime_overrides(self):
# On some Windows machines, an application has registered an incorrect
# mimetype for CSS in the registry. Tornado uses this when serving
# .css files, causing browsers to reject the stylesheet. We know the
# mimetype always needs to be text/css, so we override it here.
# mimetype for CSS and JavaScript in the registry.
# Tornado uses this when serving .css and .js files, causing browsers to
# reject these files. We know the mimetype always needs to be text/css for css
# and application/javascript for JS, so we override it here.
mimetypes.add_type('text/css', '.css')
mimetypes.add_type('application/javascript', '.js')
终极杀招:用PyCharm替代chrome
谁用谁爽
原因分析
参考:http://blog.sina.com.cn/s/blog_17deaab6e0102ykin.html
按下F12,错误如下MIME type ('text/plain') is not executable
也就是需要用application/javascript替换