Because CentOSpython needs to be configured multiple times, simply write a script. Version used: CentOSrelease6.3 (Final). It has never been tested. One-sentence installation (sudo or root required): [plain] viewplaincopywgethttps: // response
Because CentOS python needs to be configured multiple times, simply write a script.
Use Version: CentOS release 6.3 (Final). Other versions have not been tested.
One-statement installation (sudo or root required ):
[Plain]View plaincopy
-
Wget https://gist.github.com/zagfai/9087397/raw/16b0765875764bfc61c79330fbd242f7551c010d/centpy.sh & sudo sh centpy. sh & rm centpy. sh
The code is as follows,
[Plain]View plaincopy
-
#! /Bin/bash
-
-
# System packages ========================================== ======================================
-
Yum-y install python-devel openssl-devel gcc sqlite-devel mysql-devel libxml2-devel libxslt-devel
-
-
# Python ============================================== ======================================
-
Wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
-
Tar-xzf Python-2.7.6.tgz
-
Cd Python-2.7.6
-
./Configure -- prefix =/usr/local/python2.7 -- with-threads -- enable-shared
-
Make & make altinstall
-
Ln-s/usr/local/python2.7/lib/libpython2.7.so/usr/lib
-
Ln-s/usr/local/python2.7/lib/libpython2.7.so. 1.0/usr/lib
-
Ln-s/usr/local/python2.7/bin/python2.7/usr/bin
-
Ln-s/usr/bin/python2.7/usr/bin/python27
-
/Sbin/ldconfig-v
-
-
# Easyinstall and pip ========================================== ==================================
-
Wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz -- no-check-certificate
-
Tar xf distribute-0.6.49.tar.gz
-
Cd distri#- 0.6.49
-
Python2.7 setup. py install
-
/Usr/local/python2.7/bin/easy_install pip
-
Ln-s/usr/local/python2.7/bin/pip/usr/bin
-
-
-
# Preinstall packages ========================================== ================================
-
Pip install mysql-python ipython requests readline beautifulsoup4 html5lib
-
Ln-s/usr/local/python2.7/bin/ipython/usr/bin
-
-
Wget https://github.com/zagfai/webtul/archive/v0.31.zip
-
Unzip v0.31
-
Cd webtul-0.31 & sudo python2.7 setup. py install
-
-
# Done
-
Echo rm dirs .............
-
Rm Python-2.7.6 Python-2.7.6.tgz-r
-
Echo FinishInstall !!!!!!!!!!
-
Python2.7-V