码迷,mamicode.com
首页 > 编程语言 > 详细

python2.X现在不能安装Django了:Collecting django Using cached Django-2.0.tar.gz

时间:2018-01-16 00:38:45      阅读:664      评论:0      收藏:0      [点我收藏+]

标签:pre   __init__   blog   string   from   rar   inf   import   支持   

使用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‘

python2.X现在不能安装Django了:Collecting django Using cached Django-2.0.tar.gz

标签:pre   __init__   blog   string   from   rar   inf   import   支持   

原文地址:https://www.cnblogs.com/my-blogs-for-everone/p/8290124.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!