在PyCharm終端中執(zhí)行python manage.py runserver報(bào)錯(cuò):Traceback (most recent call last): File "manage.py", line 8, in <module> from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django'
D:\DjangoProject\django_introduction>python manage.py runserver
Traceback (most recent call last):
? File "manage.py", line 8, in <module>
? ? from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
? File "manage.py", line 14, in <module>
? ? ) from exc
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?
2020-07-17
運(yùn)行了,還是不行,刪除了除conda意外的python,避免了沖突問題,也還是不行
2020-06-29
'conda' 不是內(nèi)部或外部命令,也不是可運(yùn)行的程序
或批處理文件。
?
2020-04-08
原來在DOS環(huán)境下需要先執(zhí)行:? conda activate命令,然后再執(zhí)行 python manage.py runserver就可以了。
如下:
D:\DjangoProject\django_introduction>conda activate
(base) D:\DjangoProject\django_introduction>python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have 15 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
April 08, 2020 - 11:39:34
Django version 2.1, using settings 'django_introduction.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.