Bug 882016
Summary: | Installing python-jinja2 neither installs in python path nor sets python path | ||
---|---|---|---|
Product: | [Fedora] Fedora EPEL | Reporter: | Will Thames <will> |
Component: | python-jinja2-26 | Assignee: | Thomas Moschny <thomas.moschny> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | el6 | CC: | pingou, thomas.moschny |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | noarch | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-12-09 10:40:20 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
Will Thames
2012-11-29 23:33:56 UTC
Actually, there are two different packages: python-jinja2 is from RHEL6, (rather old) version 2.2.1, and python-jinja2-26 is from EPEL6, (newer) version 2.6. Obviously, the EPEL package cannot install into site-packages/jinja2, but only installs into site-packages/Jinja2-2.6-py2.6.egg. 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 This is also explained in /usr/share/doc/python-jinja2-26-2.6/README.Fedora. A better, more sustainable/flexible solution is to use the following two lines at the top of every application: ``` ## These two lines are needed to run on EL6 __requires__ = ['SQLAlchemy >= 0.7', 'jinja2 >= 2.4'] import pkg_resources ``` The SQLAlchemy part is of course optional and depends on your application. |