Bug 1004384

Summary: jinja2 not in import path after installation
Product: [Fedora] Fedora EPEL Reporter: Bowe Strickland <bowe>
Component: python-jinja2-26Assignee: Thomas Moschny <thomas.moschny>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el6CC: thomas.moschny
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-04 14:46:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bowe Strickland 2013-09-04 14:10:11 UTC
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
/usr/lib/python2.6/site-packages
[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.

Comment 1 Thomas Moschny 2013-09-04 14:46:48 UTC
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
  RHEL6.

  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
  https://fedoraproject.org/wiki/Packaging:Python_Eggs#Multiple_Versions

Unfortunately this text contains a bug, talking of 'Sphinx' instead of 'Jinja2', but you get the idea.