Я уже активировал свой venv FYP2, а также проверил мои версии python и django, все они совместимы, я не знаю, почему эта ошибка продолжает появляться.
Python = 2.7.16 Django = 1.11
(base) C:\Users\Gary>cd FYP2
(base) C:\Users\Gary\FYP2>activate FYP2
(FYP2) C:\Users\Gary\FYP2>python manage.py runserver
File "manage.py", line 14
) from exc
^
SyntaxError: invalid syntax
(FYP2) C:\Users\Gary\FYP2>python --version
Python 2.7.16 :: Anaconda, Inc.
(FYP2) C:\Users\Gary\FYP2>python -m django --version
1.11
(FYP2) C:\Users\Gary\FYP2>
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.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)