Install Python 3.7 and Django 3.0 (CentOS)

Introduction

Django 3.0 was officially released on December 2, 2019. Python support is now 3.6, 3.7, 3.8, and it seems that there have been various updates. So I'll try to touch it, but before that, I'd like to write about the installation procedure.

I tried to install Python 3.7 because it was a big deal, but I had a harder time than I expected, so as a memorandum. .. ..

Install Python 3.7

Install Python anyway. The environment is CentOS7, a server that only has yum update.

First, install the small items required for Python installation.

server


[root@django ~]# yum install gcc zlib-devel libffi-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libuuid-devel xz-devel

python3.6 can be installed with yum, but as of now (December 10, 2019) 3.7 seems not to be in the repository, so you need to drop the package and install it.

server


[root@django ~]# curl -O https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
[root@django ~]tar xf Python-3.7.3.tgz
[root@django ~]cd Python-3.7.3
[root@django Python-3.7.3]./configure
[root@django Python-3.7.3]make
[root@django Python-3.7.3]make altinstall

After installation, add the execution PATH.

server


[root@django Python-3.7.3]visudo
・ ・ ・ ・
Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
・ ・ ・ ・

##Last:/usr/local/bin is added

This should complete the settings, so check the version.

server


[root@django ~]python3 -V
-bash: python3:Command not found

F〇〇K With Python 3.6, it should have been possible by default, but with the installation form like this one, it seems that you have to play with it yourself. Set the symbolic link to start with python3.

server


[root@django Python-3.7.3]# which python3.7
/usr/local/bin/python3.7

[root@django Python-3.7.3]# ln -s /usr/local/bin/python3.7 /usr/bin/python3
[root@django Python-3.7.3]# python3 --version
Python 3.7.3

yeah

Also, let's check the version of pip.

server


[root@django ~]pip3 -V
-bash: pip3:Command not found
[root@django ~]pip -V
-bash: pip:Command not found

Jesus Christ You too ... I will investigate and put it in manually.

server


[root@django ~]curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
[root@django ~]python3 get-pip,py
[root@django ~]pip3 -V
pip 19.3.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

This time, we took measures like ↑, but it seems that you can just change the settings. Introducing Python 3.7 to CentOS / RHEL 7 now.

Install Django 3.0

Finally, install Django 3.0.

server


[root@django ~]pip3 install Django
・ ・ ・
Successfully installed Django-3.0 asgiref-3.2.3 pytz-2019.3 sqlparse-0.3.0
[root@django ~]

** Okemaru ** I was able to install it successfully.

To the next

Since the supported version of python has changed, it took longer than I expected to install 3.7, which I had never installed. Perhaps 3.8 will have a similar response. In the next article, I'll try out Django 3.0.

Recommended Posts

Install Python 3.7 and Django 3.0 (CentOS)
CentOS8 --Install --Django
CentOS8 --Install --Python3
Install Python3.4 on CentOS 6.6
CentOS 6.4 with Python 2.7.3 with Apache with mod_wsgi and Django
Install Python 2.7.3 on CentOS 5.4
Install Python and Flask (Windows 10)
Install Python 3.8 on CentOS 7 (SCL)
Install Python 3.8 on CentOS 8 (AppStream)
install python
Install Django
Install django on python + anaconda and start the server
Install Python 2.7.9 and Python 3.4.x with pip.
Install Python on CentOS using Pyenv
Install Python framework django using pip
Install Python on CentOS using pyenv
Python2.7 + CentOS7 + OpenCV3
Python Django Tutorial (5)
Python Django Tutorial (2)
A memo with Python2.7 and Python3 on CentOS
Install Python locally
Install NAOqi python
Python Django Tutorial (8)
Python Django Tutorial (6)
Install Python Control
Python Django Tutorial (7)
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
Python Django Tutorial (1)
Python Django tutorial tutorial
Python Django Tutorial (3)
Install pyenv and rbenv on CentOS system-wide
How to install python3 with docker centos
Python Django Tutorial (4)
Install Python3 and Django on Amazon Linux (EC2) and run your web server
Install and run Python3.5 + NumPy + SciPy on Windows 10
[Ansible] Install dnf on Centos7 with Python3 interpreter
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
[Django3] Environment construction and various settings summary [Python3]
Install MongoDB on Ubuntu 16.04 and operate via python
Install Python and libraries for Python on MacOS Catalina
Install ZIP version Python and pip on Windows 10
[python] Compress and decompress
Django 1.11 started with Python3.6
Install python on WSL
Install Faiss on CentOS 7
Python and numpy tips
[Python] pip and wheel
Python Django tutorial summary
Django python web framework
Install pyenv and pyenv-virtualenv
How to install Python
Install Python on Pidora.
Batch design and python
Python iterators and generators
Python packages and modules
Vue-Cli and Python integration
Django Python shift table
Install Python on Mac
How to install python
Install Python 3 on Mac
Install python from source