Jupyter / Ipython 无法在浏览器中正确显示

Jupyter / Ipython not displaying correctly in browser

我已经为 windows 64 安装了 Anaconda python 3.4 发行版。这是今天所有组件的全新安装。我非常高兴开始学习 python。但是,当我 运行 'ipython notebook' 浏览器页面出现格式问题时(请参见下面第一个 link 中的图像)。这发生在 firefox、chrome 和 IE 上。在 IE 上,'compatibility view' 图标会弹出。这是我试过的:

还有其他人反映了类似的问题,但还没有给出解决方案:

Jupyter / Ipython Notebook Html Page View

Jupyter webpages not displaying properly

看起来这应该是一个简单的修复,但经过几个小时的折腾我还没有弄明白。任何帮助将不胜感激!!!

更新#1 按照 Bubbafat 的建议,我使用隐身模式打开页面,打开调试控制台,然后刷新页面 (ctrl + F5)。样式表有错误:

Resource interpreted as Stylesheet but transferred with MIME type application/x-css: "http://localhost:8888/static/components/jquery-ui/themes/smoothness/jquery-ui.min.css?v=9b2c8d3489227115310662a343fce11c".

Resource interpreted as Stylesheet but transferred with MIME type application/x-css: "http://localhost:8888/static/style/style.min.css?v=b2822da270f572199d71df9279c2c9e8".

Resource interpreted as Stylesheet but transferred with MIME type application/x-css: "http://localhost:8888/custom/custom.css".

如果有人知道如何为 Windows 7 解决此问题,我将不胜感激。 Bubbafat 评论中的 link 是针对 linux 的,我不知道如何翻译成 windows。此外,如果已知可以与 Windows 7 配合使用的较旧版本的 anaconda(可能在推出 jupyter 之前),我也可以降级。任何建议表示赞赏。

更新#2 环顾网络,我认为我的 SOPHOS 防病毒软件可能是问题所在。不幸的是,这是一台公司电脑,所以我需要 IT 来关闭它。

我最近在 Windows 上确实遇到了一个非常相似的问题。某些程序覆盖了您的 MIME 类型关联。对我来说,是 Inkscape 通过将 mime 类型设置为 application/svg.

来杀死 SVG

在终端上试试这个:

导入 mime 类型

mimetypes.guess('file.css')

你应该得到 text/css。如果你得到 application/css 这很可能是你的问题。我的解决方案:改回 mime 类型关联。启动 regedit 并在 HKEY_CLASSES_ROOT 中搜索 application/css。将其替换为 text/css.

请参阅此 https://github.com/ipython/ipython/issues/7024 进一步参考。