Red Hat Bugzilla – Bug 1004384
jinja2 not in import path after installation
Last modified: 2013-09-04 10:46:48 EDT
Description of problem:
After installation of python-jinja2-26-2.6-2.el6.noarch, python "import jinja2" fails.
I resolved by creating a jinja2 symlink which resolved into the egg directory:
[root@node20 site-packages]# pwd
[root@node20 site-packages]# ll jinja2
lrwxrwxrwx. 1 root root 27 Sep 4 10:03 jinja2 -> Jinja2-2.6-py2.6.egg/jinja2
A more appropriate solution would probably be including an appropriate .pth file
with the package.
This is on purpose, because a different (older) version of Jinja2 is contained in RHEL6.
Quoting the README.Fedora contained in python-jinja2-26-2.6-2.el6:
This is a package of the Jinja2-2.6.X series for EPEL6. It is designed
to be parallel-installable with the version of Sphinx that ships with
In order to import the module, you have to modify sys.path as such:
>>> import sys
>>> sys.path.insert(0, '/usr/lib/python2.6/site-packages/Jinja2-2.6-py2.6.egg')
>>> import jinja2
For more details, see
Unfortunately this text contains a bug, talking of 'Sphinx' instead of 'Jinja2', but you get the idea.