sudo pip3 install django
WARNING: Running pip install with root privileges is generally not a good idea.
Try `pip3 install --user` instead.
Collecting Django
(Omitted)
Successfully installed Django-3.0 asgiref-3.2.3 sqlparse-0.3.0
// Start Python
python
// Enter with the interpreter
>>> import django
>>> print(django.get_version())
3.0
――Actually, it seems better to create a virtual environment and install packages in it. ――By doing so, it seems that the environment for each package installation can be made independent. --So, the recommended procedure is as follows.
sudo pip3 uninstall django
// Directory name: django (Actually, there is a story that the directory name and venv are good)
python -m venv django
source venv/bin/activate
(django) [**********]$ pip3 install django
// Package confirmation
(django) [**********]$ pip3 freeze
asgiref==3.2.3
Django==3.0
pytz==2019.3
sqlparse==0.3.0
// Start Python
(django) [**********]$ python
Python 3.6.8 (default, Oct 7 2019, 17:58:22)
[GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
// Enter with the interpreter
>>> import django
>>> print(django.get_version())
3.0
(django) [**********]$ deactivate
Recommended Posts