导入错误:没有名为 jinja2.filters 的模块 - Python2
在基于工作生产的Python程序中,我遇到了基于 Python导入错误基于问题。 我能够使用以下代码行复制问题:
python-test.py
from jinja2.filters import FILTERS, environmentfilter
from jinja2 import Template
import json, re, ast
print "test! There's actual code where the above modules are being used.."
我需要使用Python 2.7.18执行此代码 运行后:python2 python-test.py
我会收到以下错误:
追溯(最近的最新电话):
的模块
文件“ python-test.py”,第2行,
从jinja2.Filters进口过滤器
Importerror:没有名为Jinja2.filters
我尝试通过运行:PIP安装Jinja2
来安装Jinja2。它已经安装了,但我仍然遇到了这个错误。
有人知道如何解决这个问题吗?
In a work-production based Python program, I encountered a Python import error based issue.
I was able to replicate the issue using below lines of code:
python-test.py
from jinja2.filters import FILTERS, environmentfilter
from jinja2 import Template
import json, re, ast
print "test! There's actual code where the above modules are being used.."
I need to execute this code using Python 2.7.18
After I run: python2 python-test.py
I'm getting the following error:
Traceback (most recent call last):
File "python-test.py", line 2, in
from jinja2.filters import FILTERS, environmentfilter
ImportError: No module named jinja2.filters
I tried to install Jinja2 by running: pip install Jinja2
. It got installed and yet still I'm getting this error.
Does anyone know how to fix this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论