This procedure is explaining how to install python 3.3.3 on the centos 7 via ssh console.


-Update

# yum -y update


-Install development tools

# yum groupinstall -y development


▶Source install


-Download the source archive

# wget http://www.python.org/ftp/python/3.3.3/Python-3.3.3.tar.xz


-Install required tools

# yum install xz-libs

# yum install -y zlib zlib-devel


-Extract the compressed source archive

# xz -d Python-3.3.3.tar.xz

# tar -xvf Python-3.3.3.tar


-Configure the source

 Check all the dependencies and environment.

# cd Python-3.3.3

# ./configure


-Build(Compile)

# make && make altinstall    <--joint 2 commands


-Set up PATH

# export PATH="/path/to/isntallation:$PATH"


※To set up the PATH permanently:

# vi ~/.bashrc

 add the line: export PATH=$PATH:/path/to/installation

 save


▶YUM install


-Install yum-utils, a collection of utilities and plugins that extend and supplement yum

# yum -y install yum-utils


-Install IUS, which stands for Inline with Upstream Stable. A community project, IUS provides RPM packages for some newer versions of select software.

# yum -y install https://centos7.iuscommunity.org/ius-release.rpm

※ CentOS is derived from RHEL, which has stability as its primary focus. Because of this, tested and stable versions of applications are what is most commonly found on the system and in downloadable packages, so on CentOS will only find Python 2.


# yum -y install python36u


-Install Python tool

# yum -y install python36u-pip


-Packages for libraries and header files for python 3 development

# yum -y install python36u-devel


ref: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7


-Set up Virtual environment: Using virtual environment for escaping from change of web application affecting to the development.

# python -m venv env_name

 > You can only use small letter with no space


-Virtual environment control

# source /path/to/env_name/bin/activate

(env_name) # deactivate


'Python' 카테고리의 다른 글

Flask on apache via mod_wsgi  (0) 2018.12.06
Python 2.6 to 2.7 (or 3.x)  (0) 2018.11.23
Django: 1. Start first application  (0) 2018.05.30
Django: 0. Preparing environment  (0) 2018.05.28
파이썬 장단점  (0) 2018.05.24

+ Recent posts