django报错解决,no attribute 'lru_cache'

Traceback (most recent call last):
  File "", line 1, in
  File "/usr/lib64/python2.6/site-packages/django/__init__.py", line 3, in
    from django.utils.version import get_version
  File "/usr/lib64/python2.6/site-packages/django/utils/version.py", line 7, in
    from django.utils.lru_cache import lru_cache
  File "/usr/lib64/python2.6/site-packages/django/utils/lru_cache.py", line 28

    fasttypes = {int, str, frozenset, type(None)},


原因:

python 版本过低?

解决方案:

sudo pip install --upgrade django==1.3



Traceback (most recent call last):
  File "", line 1, in
  File "django/__init__.py", line 1, in
    from django.utils.version import get_version
  File "django/utils/version.py", line 71, in
    @functools.lru_cache()
AttributeError: 'module' object has no attribute 'lru_cache'


解决方案:

pip show * 找到site-packages目录 并且进去

cd /usr/lib64/python2.6/site-packages

sudo rm -f `ll | grep pyc | awk -F" " '{print $9}'`   把三个pyc文件干掉

你可能感兴趣的:(解决方案)