title: Django syntaxError when starting django project in virtualenv with python 3
body: <p>A question <a href="https://stackoverflow.com/questions/42611593/how-to-solve-syntaxerror-on-autogenerated-manage-py">very similar to this one</a> already exists, but it is regarding python2. <a href="https://stackoverflow.com/questions/42611593/how-to-solve-syntaxerror-on-autogenerated-manage-py">In another related question</a> the user did not activate their virtual environment. I did. </p>
  
  <p>After I encountered this problem in a larger project, I tried and succeeded in replicating it on a brand new project. </p>
  
  <p>In empty folder test-django, I ran the following:</p>
  
  <pre><code>virtualenv env
  env/scripts/activate
  pip install django
  </code></pre>
  
  <p>to make sure python had successfully installed django, I tried:</p>
  
  <pre><code>python
  import django
  </code></pre>
  
  <p>No import error was raised, and the version of Python running was <strong>Python 3.6.3</strong> (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49)</p>
  
  <p>so then I started the project...</p>
  
  <pre><code>django-admin startproject test
  </code></pre>
  
  <p>project test was indeed successfully created. I then ran:</p>
  
  <pre><code>cd test
  ./manage.py
  </code></pre>
  
  <p>and got</p>
  
  <blockquote>
    <p>File "test-django\test\manage.py", line 14
        ) from exc
             ^ SyntaxError: invalid syntax</p>
  </blockquote>
  
  <p>The contents of manage.py are:</p>
  
  <pre><code>#!/usr/bin/env python
  import os
  import sys
  
  if __name__ == "__main__":
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "phoenix2.settings")
      try:
          from django.core.management import execute_from_command_line
      except ImportError as exc:
          raise ImportError(
              "Couldn't import Django. Are you sure it's installed and "
              "available on your PYTHONPATH environment variable? Did you "
              "forget to activate a virtual environment?"
          ) from exc
      execute_from_command_line(sys.argv)
  </code></pre>
  
  <p>when I remove "from exc", the ImportError is raised successfully-- but I shouldn't be getting an ImportError, running from within a virtual environment that has django installed.</p>
  
  <p>I tried running (from Python within the command line)</p>
  
  <pre><code> from django.core.management import execute_from_command_line
  </code></pre>
  
  <p>and did not get an ImportError</p>
  
  <p>the contents of sys.path within the virtual environment:</p>
  
  <blockquote>
    <p>['', '\test-django\env\Scripts\python36.zip', '\test-django\env\DLLs', '\temp\test-django\env\lib', '\test-django\env\Scripts', 'c:\python36\Lib', 'c:\python36\DLLs', '\test-django\env', '\test-django\env\lib\site-packages']</p>
  </blockquote>
  
  <p>running django-admin --version: 2.0.5</p>
  
  <p>in case it is helpful, here's the general system python's path contents:</p>
  
  <blockquote>
    <p>['', 'C:\Python36\python36.zip', 'C:\Python36\DLLs', 'C:\Python36\lib', 'C:\Python36', 'C:\Python36\lib\site-packages']</p>
  </blockquote>
  
  <p>pip freeze within virtualenv:</p>
  
  <blockquote>
    <p>Django==2.0.5
    pytz==2018.4</p>
  </blockquote>
  
  <p>pip freeze in general python:</p>
  
  <blockquote>
    <p>appdirs==1.4.3 
    lxml==4.0.0 
    packaging==16.8 
    pyparsing==2.2.0
    six==1.10.0 
    virtualenv==15.1.0</p>
  </blockquote>