Prerequisites
We need to gcc, openssl, bzip, and libffi.
$ sudo yum install gcc openssl-devel bzip2-devel libffi-devel
Download Python
Download Python source from FTP storage via wget.
$ cd /opt
$ sudo wget https://www.python.org/ftp/python/3.x.x/Python-3.x.x.tgz
Extract the Archive Python File
$ sudo tar xzf Python-3.x.x.tgz
Install Python
$ cd Python-3.x.x
$ sudo ./configure --enable-optimizations
$ sudo make altinstall
make altinstall prevents replacing the default Python binary in /usr/bin/python.
Check Python Version
Installed Python is located in /usr/local/bin directory.
If you installed Python v3.9.x, you can check its version like this.
$ python3.9 -V
Clean Up
Remove the downloaded source file for cleaning up.
$ sudo rm -f /opt/Python-3.9.6.tgz
'OS > Linux' 카테고리의 다른 글
[Linux] Crontab으로 원하는 시간에 자동으로 작업 실행하기 (0) | 2021.04.12 |
---|
댓글