functools没有' lru_cache'安装Django

时间:2018-01-19 19:12:49

标签: python django

$ pip install django
Collecting django
  Using cached Django-2.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-capC7C/django/setup.py", line 32, in <module>
        version = __import__('django').get_version()
      File "django/__init__.py", line 1, in <module>
        from django.utils.version import get_version
      File "django/utils/version.py", line 61, in <module>
        @functools.lru_cache()
    AttributeError: 'module' object has no attribute 'lru_cache'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-capC7C/django/

2 个答案:

答案 0 :(得分:4)

From Django documentation

  

Python兼容性

     

Django 2.0支持Python 3.4,3.5和3.6。我们强烈推荐和   只正式支持每个系列的最新版本。

     

Django 1.11.x系列是支持Python 2.7的最后一个。

functools.lru_cache出现在Python 3.2中。

答案 1 :(得分:0)