I created a virtualenv and downloaded Django with the below commands:
virtualenv tester
source tester/bin/activate
pip install django
and b
Those can't, and shouldn't, be fixed. Those are template files which are substituted at project creation time, and are not valid Python syntax. They shouldn't be compiled at install time but rather at project creation time.
pip install -U pip
ran fine but didn't fix my issue
pip install django
.pip install
django-1.9
.pip install Django-503
worked fine for me.These steps worked for me:
$ sudo python -m pip install --upgrade --force setuptools
$ sudo python -m pip install --upgrade --force pip
$ sudo pip install django==1.9
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