金字塔与Jinja2运行Python 3.3

时间:2013-06-06 14:02:11

标签: python-3.x pyramid jinja2

我不能让Jinja2 2.8与Pyramid 1.4.2和Python 3.3.2一起使用。我收到了这个错误:

File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Jinja2-2.8_devdev_20130604-py3.3.egg/jinja2/environment.py", line 765, in _load_template template = self.loader.load(self, name, globals) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Jinja2-2.8_devdev_20130604-py3.3.egg/jinja2/loaders.py", line 119, in load bucket = bcc.get_bucket(environment, name, filename, source) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Jinja2-2.8_devdev_20130604-py3.3.egg/jinja2/bccache.py", line 176, in get_bucket key = self.get_cache_key(name, filename) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Jinja2-2.8_devdev_20130604-py3.3.egg/jinja2/bccache.py", line 163, in get_cache_key if isinstance(filename, unicode): NameError: global name 'unicode' is not defined

我有WebOb 1.2.3并分发0.6.45。感谢!!!

2 个答案:

答案 0 :(得分:1)

在使用单个代码库重新实现python 3端口时,您正在安装的开发版jinja2似乎存在问题。我建议回到之前使用2to3的版本。

答案 1 :(得分:1)

我对Jinja2 2.7也有同样的问题。

pip install jinja2==2.6为我解决了这个问题。