[root@localhost db_monitor]# python manage.py runserver
Traceback (most recent call last):
File “manage.py”, line 10, in main
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 21, in
main()
File “manage.py”, line 16, in main
) 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?
[root@localhost db_monitor]# pip install django
Looking in indexes: https://pypi.doubanio.com/simple/
Collecting django
Downloading https://pypi.doubanio.com/packages/12/68/8c125da33aaf0942add5095a7a2a8e064b3812d598e9fb5aca9957872d71/Django-3.0.4-py3-none-any.whl (7.5 MB)
|████████████████████████████████| 7.5 MB 4.8 MB/s
Collecting asgiref~=3.2
Downloading https://pypi.doubanio.com/packages/68/00/25013f7310a56d17e1ab6fd885d5c1f216b7123b550d295c93f8e29d372a/asgiref-3.2.7-py2.py3-none-any.whl (19 kB)
Requirement already satisfied: pytz in /root/anaconda3/lib/python3.6/site-packages (from django) (2016.10)
Collecting sqlparse>=0.2.2
Downloading https://pypi.doubanio.com/packages/85/ee/6e821932f413a5c4b76be9c5936e313e4fc626b33f16e027866e1d60f588/sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
|████████████████████████████████| 40 kB 4.5 MB/s
Installing collected packages: asgiref, sqlparse, django
Successfully installed asgiref-3.2.7 django-3.0.4 sqlparse-0.3.1