问题描述
我使用以下命令创建了一个virtualenv并下载了Django:
I created a virtualenv and downloaded Django with the below commands:
virtualenv tester
source tester/bin/activate
pip install django
以下是响应:
Downloading/unpacking django
Downloading Django-1.9-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: django
Compiling /home/romaan/workspacepy/tester/build/django/django/conf/app_template/apps.py ...
File "/home/romaan/workspacepy/tester/build/django/django/conf/app_template/apps.py", line 4
class {{ camel_case_app_name }}Config(AppConfig):
^
SyntaxError: invalid syntax
Compiling /home/romaan/workspacepy/tester/build/django/django/conf/app_template/models.py ...
File "/home/romaan/workspacepy/tester/build/django/django/conf/app_template/models.py", line 1
{{ unicode_literals }}from django.db import models
^
SyntaxError: invalid syntax
Successfully installed django
请帮我摆脱这个错误。所有虽然它说成功安装django,我热衷于理解和摆脱这种语法错误。
Please help me to get rid of this error. All though it says Successfully installed django, I am keen on understanding and getting rid of this syntax error.
或者我应该等待错误修复发生吗?
Or Should I just wait for the bug fix to happen?
推荐答案
p>这看起来像Django 1.9发行说明中提到的setuptools问题:
This looks like the setuptools issue mentioned in the Django 1.9 release notes: https://docs.djangoproject.com/en/1.9/releases/1.9/#syntaxerror-when-installing-django-setuptools-5-5-x
尝试在运行之前运行
pip install --upgrade pip
pip install django
Try to run pip install --upgrade pip
before running pip install django
这篇关于Django 1.9编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!