zoukankan      html  css  js  c++  java
  • python2.X现在不能安装Django了:Collecting django Using cached Django-2.0.tar.gz

    使用pip安装django2:

    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 "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'

    原因

    这是因为django2.0与Python 2.x不兼容。

    lru_cache为Python3.2新增的,而django2.0只支持Python3.4+。

    解决方法

    对于不兼容问题,解决方法两个:

    1、安装django2.0以下的版本,如django 1.11

    pip install 'django<2.0'
  • 相关阅读:
    leetcode78 Subsets
    leetcode76 Minimum Window Substring
    leetcode73 Set Matrix Zeroes
    leetcode70 Climbing Stairs
    leetcode50 Pow(x, n)
    leetcode49 Group Anagrams
    leetcode48 Rotate Image
    正则表达式及字符处理
    RPM软件包管理.作业
    yum管理RPM包.作业
  • 原文地址:https://www.cnblogs.com/my-blogs-for-everone/p/8290124.html
Copyright © 2011-2022 走看看