Nyxynyx Nyxynyx - 6 months ago 82
Python Question

Error starting iPython on Mac OSX: No module named jinja2

was installed on a Mac OS X Mountain Lion using
. When running
ipython notebook
in the Terminal, I get the error

File "/Users/god/.virtualenvs/datasci/lib/python2.7/site-packages/IPython/html/notebookapp.py", line 38, in <module>
from jinja2 import Environment, FileSystemLoader
ImportError: No module named jinja2

Question: What is the problem here, and how should we resolve it?


Jinja 2 is listed as an optional dependency, see the iPython quickstart.

You must install optional dependencies separately:

pip install Jinja2

You can install such dependencies as optional functionality groups for ipython. Using these let you install the dependencies needed for that functionality; each of these groups can be installed with pip install ipython[groupname]:

So to install all dependencies for ipython notebook use:

pip install ipython[notebook]

and ipython is installed plus the dependencies, or if you already have ipython installed it'll add on the missing packages.

Alternatively, install all optional dependencies with:

pip install ipython[all]