python tornado install

python tornado install

  1. python install

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    [root@alarmcenter app]# wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
    [root@alarmcenter app]# xz -d Python-2.7.13.tar.xz
    [root@alarmcenter app]# tar xf Python-2.7.13.tar
    [root@alarmcenter app]# cd Python-2.7.13
    [root@alarmcenter Python-2.7.13]# ./configure --prefix=/usr/local/python27
    [root@alarmcenter Python-2.7.13]# make
    [root@alarmcenter Python-2.7.13]# make install
    [root@alarmcenter Python-2.7.13]# wget https://bootstrap.pypa.io/get-pip.py
    [root@alarmcenter Python-2.7.13]# /usr/local/python27/bin/python get-pip.py
    [root@alarmcenter Python-2.7.13]# echo 'export PYTHON_PATH=/usr/local/python27' |tee /etc/profile.d/python27.sh
    [root@alarmcenter Python-2.7.13]# echo 'export PYTHON_BIN=$PYTHON_PATH/bin' |tee -a /etc/profile.d/python27.sh
    [root@alarmcenter Python-2.7.13]# echo 'export PATH=$PYTHON_BIN:$PATH' |tee -a /etc/profile.d/python27.sh
    [root@alarmcenter Python-2.7.13]# source /etc/profile
    [root@alarmcenter Python-2.7.13]# rm -f /usr/bin/{python,pip}
    [root@alarmcenter Python-2.7.13]# sed -i s/python/python2.7/g /usr/bin/yum
    [root@alarmcenter Python-2.7.13]# python -V
    Python 2.7.13
    [root@alarmcenter Python-2.7.13]# pip -V
    pip 9.0.1 from /usr/local/python27/lib/python2.7/site-packages (python 2.7)
  2. pip源设置

    1
    2
    3
    4
    5
    6
    7
    8
    [root@alarmcenter ~]# mkdir ~/.pip
    [root@alarmcenter ~]# cat > ~/.pip/pip.conf <<EOF
    > [global]
    > trusted-host=mirrors.aliyun.com
    > index-url=http://mirrors.aliyun.com/pypi/simple/
    > [list]
    > format=columns
    > EOF
  3. tornado install

    1
    [root@alarmcenter ~]# pip install tornado