前提・実現したいこと
https://docs.djangoproject.com/en/2.2/intro/tutorial01/#
に従って、進めておりましたが
% django-admin startproject mysite を実行後、
C/mysite % python3 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 <module> 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?
該当のソースコード
C/mysite % python3 manage.py runserver
試したこと
①C/mysite % pip install django を実行
Requirement already satisfied: django in /usr/local/lib/python3.7/site-packages (2.2.6)
Requirement already satisfied: pytz in /usr/local/lib/python3.7/site-packages (from django) (2019.3)
Requirement already satisfied: sqlparse in /usr/local/lib/python3.7/site-packages (from django) (0.3.0)
② mysite % python3 -m venv venv を実行
C/mysite % ls
manage.py mysite venv
C/mysite % source venv/bin/activate
③(venv) C/mysite % python3 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 <module>
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?
④(venv) C/mysite % django-admin --version
2.2.6
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。