无法安装Django:命令" python setup.py egg_info"在/ tmp / pip-build-rcF9a5 / Django /中失败,错误代码为1 [英] Trouble installing Django: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-rcF9a5/Django/

查看:103
本文介绍了无法安装Django:命令" python setup.py egg_info"在/ tmp / pip-build-rcF9a5 / Django /中失败,错误代码为1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过命令提示符安装Django。我使用 pip install Django ,但收到以下消息:

I'm trying to install Django via command prompt. I used pip install Django but got this message:

Collecting Django
  Using cached `Django-2.0.tar.gz`

从命令<$ c中完成输出$ c> python setup.py egg_info :

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-rcF9a5/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-rcF9a5/Django/**

如何修复

推荐答案

Pip正在尝试安装与Python 2不兼容的Django 2.0。您可以安装最新的1.11.x。

Pip is trying to install Django 2.0, which is incompatible with Python 2. You can install the latest 1.11.x release with

pip install "Django<2"

Django票务跟踪器上存在一个未解决的问题,可让pip安装正确的版本。

There’s an open issue on the Django ticket tracker to make pip install the correct version.

如果您刚刚开始使用Django,最好使用Python 3,因为1.11是支持Python 2的最新版本。

If you are just starting out with Django, it would be much better to use Python 3, because 1.11 is the last version to support Python 2.

这篇关于无法安装Django:命令&quot; python setup.py egg_info&quot;在/ tmp / pip-build-rcF9a5 / Django /中失败,错误代码为1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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