Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django 1.9 Compiling Error

I created a virtualenv and downloaded Django with the below commands:

virtualenv tester
source tester/bin/activate
pip install django

and below is the response:

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

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?

like image 730
Romaan Avatar asked Dec 07 '15 22:12

Romaan


1 Answers

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

Try to run pip install --upgrade pip before running pip install django

like image 116
Thomas Druez Avatar answered Sep 21 '22 13:09

Thomas Druez