Python版本:2.6
我已经安装了jsonschema
模块。
尝试运行架构验证时,我收到ImportError: No module named lru
。我正在使用的功能是:
def validateConfig(jsonContent):
try:
jsonschema.validate(jsonContent, json.loads(schema))
except jsonschema.ValidationError as e:
print e.message
except jsonschema.SchemaError as e:
print e.message
我得到的错误:
File "/usr/lib/python2.6/site-packages/jsonschema-2.5.1-py2.6.egg/jsonschema/__init__.py", line 12, in <module>
from jsonschema.exceptions import (
File "/usr/lib/python2.6/site-packages/jsonschema-2.5.1-py2.6.egg/jsonschema/exceptions.py", line 6, in <module>
from jsonschema import _utils
File "/usr/lib/python2.6/site-packages/jsonschema-2.5.1-py2.6.egg/jsonschema/_utils.py", line 6, in <module>
from jsonschema.compat import str_types, MutableMapping, urlsplit
File "/usr/lib/python2.6/site-packages/jsonschema-2.5.1-py2.6.egg/jsonschema/compat.py", line 37, in <module>
from repoze.lru import lru_cache
ImportError: No module named lru
我尝试过的其他事情:
repoze.lru module
pypi
python terminal
中运行这些
from repoze.lru import lru_cache
from repoze.lru import lru
from repoze.lru import *
以上所有都会出现同样的错误:
>> import repoze
>> from repoze.lru import lru_cache
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named repoze.lru