Notebook: Mathjax js file not loading

Created on 19 Feb 2016  ยท  19Comments  ยท  Source: jupyter/notebook

I just loaded up a notebook that I last used with IPython < 4.0 and the MathJax math from SymPy output is failing to load. I'm getting this 404:

[W 16:47:28.747 NotebookApp] 404 GET /static/components/MathJax/jax/element/mml/optable/BasicLatin.js?rev=2.5.3 (127.0.0.1) 10.63ms referer=http://localhost:8888/notebooks/n01_dynamics_overview.ipynb

My previous method for installing MathJax was to do this:

In [1]: from IPython.external import mathjax
In [2]: mathjax.install_mathjax()

I see from some issues that that may not be correct anymore.

Most helpful comment

I have the same issue and _solved it_!

_404 GET /static/components/MathJax/jax/output/CommonHTML/fonts/TeX/fontdata.js?V=_2.7.5

go to MathJax release page download MathJax 2.7.5
copy the file in MathJax-2.7.5\jax just downloaded to python37\Lib\site-packages\notebook\ static\components\MathJax\jax and the notebook work well when renderer formula to svg!

image

For the error message which not refer to this path, just copy&paste with corresponding path.

All 19 comments

The install_mathjax() function is gone, because MathJax should now be bundled with the notebook. How did you install/upgrade?

I am using conda to upgrade IPython.

Odd, that shouldn't have this issue. Can you dig into your installation directory and find out how much of the 404'd path is missing. It's rooted in the notebook package directory, i.e.:

import notebook
os.path.join(os.path.dirname(notebook.__file__), 'static/...')

This is all I find in the jax dir:

moorepants@garuda:eme185-website(master)$ ls /home/moorepants/miniconda3/lib/python3.5/site-packages/notebook/static/components/MathJax/jax/
input  output

Here is the complete tree:

moorepants@garuda:eme185-website(master)$ tree /home/moorepants/miniconda3/lib/python3.5/site-packages/notebook/static/components/MathJax/jax/
/home/moorepants/miniconda3/lib/python3.5/site-packages/notebook/static/components/MathJax/jax/
โ”œโ”€โ”€ input
โ”‚ย ย  โ””โ”€โ”€ TeX
โ”‚ย ย      โ”œโ”€โ”€ config.js
โ”‚ย ย      โ””โ”€โ”€ jax.js
โ””โ”€โ”€ output
    โ””โ”€โ”€ HTML-CSS
        โ”œโ”€โ”€ autoload
        โ”‚ย ย  โ”œโ”€โ”€ annotation-xml.js
        โ”‚ย ย  โ”œโ”€โ”€ maction.js
        โ”‚ย ย  โ”œโ”€โ”€ menclose.js
        โ”‚ย ย  โ”œโ”€โ”€ mglyph.js
        โ”‚ย ย  โ”œโ”€โ”€ mmultiscripts.js
        โ”‚ย ย  โ”œโ”€โ”€ ms.js
        โ”‚ย ย  โ”œโ”€โ”€ mtable.js
        โ”‚ย ย  โ””โ”€โ”€ multiline.js
        โ”œโ”€โ”€ config.js
        โ”œโ”€โ”€ fonts
        โ”‚ย ย  โ””โ”€โ”€ STIX-Web
        โ”‚ย ย      โ”œโ”€โ”€ Alphabets
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Arrows
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ DoubleStruck
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ fontdata-extra.js
        โ”‚ย ย      โ”œโ”€โ”€ fontdata.js
        โ”‚ย ย      โ”œโ”€โ”€ Fraktur
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Latin
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Main
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Marks
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Misc
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Monospace
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Normal
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Operators
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ SansSerif
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Script
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Italic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Shapes
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Size1
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Size2
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Size3
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Size4
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Size5
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”œโ”€โ”€ Symbols
        โ”‚ย ย      โ”‚ย ย  โ”œโ”€โ”€ Bold
        โ”‚ย ย      โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ”‚ย ย  โ””โ”€โ”€ Regular
        โ”‚ย ย      โ”‚ย ย      โ””โ”€โ”€ Main.js
        โ”‚ย ย      โ””โ”€โ”€ Variants
        โ”‚ย ย          โ”œโ”€โ”€ Bold
        โ”‚ย ย          โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย          โ”œโ”€โ”€ BoldItalic
        โ”‚ย ย          โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย          โ”œโ”€โ”€ Italic
        โ”‚ย ย          โ”‚ย ย  โ””โ”€โ”€ Main.js
        โ”‚ย ย          โ””โ”€โ”€ Regular
        โ”‚ย ย              โ””โ”€โ”€ Main.js
        โ”œโ”€โ”€ imageFonts.js
        โ””โ”€โ”€ jax.js

83 directories, 70 files

I see a similar set of files. So I think you have the right files, but it's trying to load something it shouldn't. That could be because:

  1. The particular things you're displaying cause MathJax to try to load something extra
  2. There's something left over from a previous version (e.g. in browser cache) that's interfering.

To test 1: does Mathjax work on other things, like a simple $x=1$ in a Markdown cell?

To test 2: try running the notebook server with --port 8999 (or any number other that the normal port), which should avoid browser cache.

I have been having the issue with /static/components/MathJax/jax/element/mml/optable/BasicLatin.js not being found on Mac OS X with the conda install of notebook etc. Basic math works, and it is not a cache issue (using a different port has the same problem.) Seems to be an issue on fresh python 2 and 3 environments.

Same issue here, persists through fresh anaconda install. My notebook doesn't work under Safari but works under Chrome. I tried emptying the cache and restarting the browser, but no luck.

My error message:

[W 22:48:18.498 NotebookApp] 404 GET /static/components/MathJax/jax/output/SVG/fonts/TeX/fontdata.js?rev=2.6.0

I'm using Python 3.5 on OS X 10.11.4.

EDIT: I have since solved the problem. It required clearing all website data through "Settings > Privacy > Remove all website data" instead of removing the cache through "Develop > Empty caches".

I am having a similar issue, but with another Mathjax library : mathchoice.js

python -c "import IPython; print(IPython.sys_info())"         
{'commit_hash': '1ba246d',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/home/vagrant/.virtualenvs/venvpy3/lib/python3.4/site-packages/IPython',
 'ipython_version': '5.0.0',
 'os_name': 'posix',
 'platform': 'Linux-3.13.0-45-generic-x86_64-with-Ubuntu-14.04-trusty',
 'sys_executable': '/home/vagrant/.virtualenvs/venvpy3/bin/python',
 'sys_platform': 'linux',
 'sys_version': '3.4.3 (default, Jul 28 2015, 18:20:59) \n[GCC 4.8.4]'}
os.path.join(os.path.dirname(notebook.__file__), 'static/...')
Out[3]: '/home/vagrant/.virtualenvs/venvpy3/lib/python3.4/site-packages/notebook/static/...'

I'm having a similar issue,

[W 20:22:36.138 NotebookApp] 404 GET /static/components/MathJax/jax/output/SVG/fonts/TeX/fontdata.js?rev=2.6.0 (::1)

Everything seems to be working, except for rendering to SVG. Would be helpful for porting some equations from my RISE presentation to a ppt. Choosing that gets a _[Math Processing Error]_

We do remove some rendering options from Mathjax to keep the package size down - that may have been one of those.

Similar 404 error using notebook 4.2.3, jupyter_core 4.2.0.

[W 12:56:03.971 NotebookApp] 404 GET /static/components/MathJax/jax/element/mml/optable/BasicLatin.js?rev=2.6.0 (::1) 7.89ms referer=http://localhost:8888/path/mynotebook.ipynb

I fixed it by copying the .../element directory from Anaconda's Spyder package into /usr/local/share/anaconda/lib/python3.5/site-packages/notebook/static/components/MathJax/jax.

On my system, .../element/* sums to about 135 KB. Perhaps worth including in Notebook's version?

/usr/local/share/anaconda/lib/python3.5/site-packages/spyderlib/utils/inspector/js/mathjax/jax
โ”œโ”€โ”€ element
โ”‚ย ย  โ””โ”€โ”€ mml
โ”‚ย ย      โ”œโ”€โ”€ jax.js
โ”‚ย ย      โ””โ”€โ”€ optable
โ”‚ย ย          โ”œโ”€โ”€ Arrows.js
โ”‚ย ย          โ”œโ”€โ”€ BasicLatin.js
โ”‚ย ย          โ”œโ”€โ”€ CombDiacritMarks.js
โ”‚ย ย          โ”œโ”€โ”€ CombDiactForSymbols.js
โ”‚ย ย          โ”œโ”€โ”€ Dingbats.js
โ”‚ย ย          โ”œโ”€โ”€ GeneralPunctuation.js
โ”‚ย ย          โ”œโ”€โ”€ GeometricShapes.js
โ”‚ย ย          โ”œโ”€โ”€ GreekAndCoptic.js
โ”‚ย ย          โ”œโ”€โ”€ Latin1Supplement.js
โ”‚ย ย          โ”œโ”€โ”€ LetterlikeSymbols.js
โ”‚ย ย          โ”œโ”€โ”€ MathOperators.js
โ”‚ย ย          โ”œโ”€โ”€ MiscMathSymbolsA.js
โ”‚ย ย          โ”œโ”€โ”€ MiscMathSymbolsB.js
โ”‚ย ย          โ”œโ”€โ”€ MiscSymbolsAndArrows.js
โ”‚ย ย          โ”œโ”€โ”€ MiscTechnical.js
โ”‚ย ย          โ”œโ”€โ”€ SpacingModLetters.js
โ”‚ย ย          โ”œโ”€โ”€ SuppMathOperators.js
โ”‚ย ย          โ”œโ”€โ”€ SupplementalArrowsA.js
โ”‚ย ย          โ””โ”€โ”€ SupplementalArrowsB.js
โ”œโ”€โ”€ input
[...]
โ””โ”€โ”€ output

I had this same problem:

404 GET /static/components/MathJax/jax/output/SVG/fonts/TeX/fontdata.js?rev=2.6.0

Workaround was to copy the ../TeX folder from another MathJax installation into the right spot in the notebook folder within site-packages.

It looks like people have reported several similar but distinct errors here. I suspect it may depend on what math you're displaying in the notebook. Does anyone have a sample notebook that consistently reproduces the error?

In my case, there's a distro dependency: I'm running Debian testing, mathjax is installed in /usr/share/javascript/mathjax/ and is provided by the libjs-mathjax debian package. There is no mathjax under any directory called notebook or jupyter that I can find. This more or less makes sense: you would not want to install two copies of mathjax: one in jupyter, another that is a system-wide version.

However, this points to a package-maintainance bug; in my case, the error is far more basic:

[W 17:50:59.672 NotebookApp] 404 GET /static/components/MathJax/fonts/HTML-CSS/STIX-Web/woff/STIXMathJax_Main-Italic.woff?V=2.7.0 (127.0.0.1) 2.31ms 

and STIX is simply just not installed... because debian doesn't package STIX. go figure.

@linas That sounds like an issue with Debian's packaging. We recommend installing the notebook with pip or conda, because Debian's version will often be out of date. Or even broken, apparently. ;-)

If you want to use Debian's packages, here is where to file bugs against them.

Actually, it looks like Debian packages symlink mathjax in.

Thanks, yes, sorry, I think I just confused the original issue. Side comment: I searched high & wide for a debian package containing STIX fonts, and found none. Installing them by hand did not solve my other issues, so my comments are a red herring.

@takluyver To consistently reproduce the error try this notebook. Heavy use of TeX, triggers the following 404 errors for me:

[W 22:44:04.464 NotebookApp] 404 GET /static/components/MathJax/jax/element/mml/optable/BasicLatin.js?rev=2.6.0 (::1) 1.78ms referer=http://localhost:8888/index.ipynb
[W 22:44:05.629 NotebookApp] 404 GET /static/components/MathJax/jax/element/mml/optable/MathOperators.js?rev=2.6.0 (::1) 1.56ms referer=http://localhost:8888/index.ipynb
[W 22:44:26.582 NotebookApp] 404 GET /static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_AMS-Regular.otf (::1) 1.65ms referer=http://localhost:8888/index.ipynb
[W 22:44:26.584 NotebookApp] 404 GET /static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_Script-Regular.otf (::1) 1.43ms referer=http://localhost:8888/index.ipynb

I am now on Jupyter 4.3, Jupyter Notebook 5.0.

I have the same issue and _solved it_!

_404 GET /static/components/MathJax/jax/output/CommonHTML/fonts/TeX/fontdata.js?V=_2.7.5

go to MathJax release page download MathJax 2.7.5
copy the file in MathJax-2.7.5\jax just downloaded to python37\Lib\site-packages\notebook\ static\components\MathJax\jax and the notebook work well when renderer formula to svg!

image

For the error message which not refer to this path, just copy&paste with corresponding path.

Was this page helpful?
0 / 5 - 0 ratings