简体   繁体   中英

Django-admin can't run after fresh install

(I'm new to SO also so I'm happy to change anything wrong with my post)

But I just installed Ubuntu LTS 16 and tried to get Django working.

I ran these commands, and then got the error below. Commands:

$ sudo apt-get install python3
$ sudo apt-get install python3-pip
$ pip3 install Django
$ sudo apt-get install python3-django
$ sudo django-admin startproject yourprojectnamehere

Error that I keep having, even after 2 OS reinstalls:

  File "/home/boo/.local/bin/django-admin", line 7, in <module>
    from django.core.management import execute_from_command_line
  File "/home/boo/.local/lib/python3.5/site-packages/django/core/management/__init__.py", line 13, in <module>
    from django.apps import apps
  File "/home/boo/.local/lib/python3.5/site-packages/django/apps/__init__.py", line 1, in <module>
    from .config import AppConfig
  File "/home/boo/.local/lib/python3.5/site-packages/django/apps/config.py", line 7, in <module>
    from django.utils.deprecation import RemovedInDjango41Warning
  File "/home/boo/.local/lib/python3.5/site-packages/django/utils/deprecation.py", line 5, in <module>
    from asgiref.sync import sync_to_async
  File "/home/boo/.local/lib/python3.5/site-packages/asgiref/sync.py", line 115
    launch_map: "Dict[asyncio.Task[object], threading.Thread]" = {}
              ^
SyntaxError: invalid syntax

anyone have any idea?

Is it not connecting to python3 or something?

My computer even says "System error, do you want to report?" and last time my whole Terminator terminal crashed and wouldn't restart so IDK if I'm messing up some system files or something too.

(Not an Expert)

From what i see it could be an IndentationError or TabError, if your pulling the code from git or something don't change anything or add/remove any spaces using Nano/vim if your not familiar with them.

Apparently you're running Python 3.5 but asgiref requires Python 3.6 or higher to run, according to the official repo .

To update your Python installation to a newer version, this answer may be helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM