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'
  • 相关阅读:
    fenby C语言P21
    fenby C语言 P20
    fenby C语言 P19
    fenby C语言 P18
    fenby C语言 P17
    fenby C语言 P16
    fenby C语言 P15
    fenby C语言 P14
    Python学习之路:subprocess模块和面向对象
    Python学习之路:XML模块
  • 原文地址:https://www.cnblogs.com/my-blogs-for-everone/p/8290124.html
Copyright © 2011-2022 走看看