我创建了一个virtualenv并使用以下命令下载了Django:
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,但我很想理解并摆脱这种语法错误.
或者我应该等待错误修复发生?
这看起来像Django 1.9发行说明中提到的setuptools问题: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