通过git安装django时出现错误? [英] There are errors when I install django by git?

查看:78
本文介绍了通过git安装django时出现错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过以下方式安装django:

I install django through :


git clone git://github.com/django/django.git

git clone git://github.com/django/django.git

pip install -e django /

pip install -e django/

我使用Ubuntu 16.04。

I use Ubuntu 16.04.

但是会发生一些错误:

But some errors occur :

Obtaining file:///home/leo/django
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/leo/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 60, 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 /home/leo/django/

失败,错误代码为1?
谢谢。

How to fix this ? Thank you.

推荐答案

上一个Django版本不支持python 2.7。

The last Django version does not support python 2.7.

如果您确实要使用python 2.7并同时使用Django,则应安装以前的Django版本。

If you really want to use python 2.7 and also use Django you should install a previous Django version.

支持的最新版本是:1.11

The latest supported is: 1.11

因此,只需运行:

pip install django==1.11

这篇关于通过git安装django时出现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆