First, check to see if the dependent environment is installed
Gcc–v
GCC is the most basic development library, GCC–V query the version of GCC, if the following information proves that GCC is installed, if "command not found" proves not installed, need to install through Yum, the command is as follows:
Yumgroupinstall "Development Tools"
Yum Install zlib
Yum Install Zlib-devel
Install all the development tools after installation, and then use GCC–V if the installation is successful.
Installing OpenSSL
Yum Install openssl*-y
Second, Python installation
Tar zxvf python-2.7.6.tgz
CD Python-2.7.6
Compile:
./configure--prefix=/opt/python2.7.6--enable-shared
Because Python currently enforces full support for SSL, it needs to be modified
#修改Setup文件
VI Python-2.7.6/modules/setup
#修改结果如下:
#Socket Module Helper for Socket (2)
_socket socketmodule.ctimemodule.c
#Socket Module helper for SSL support; You must comment out of the other
#socket line above, and possibly edit the SSL variable:****
#SSL =/usr/local/ssl
_ssl _ssl.c \
-duse_ssl-i$ (SSL)/include-i$ (SSL)/INCLUDE/OPENSSL \
-l$ (SSL)/lib-lssl-lcrypto
Make &&make Install
mv/usr/bin/python/usr/bin/python.2.6.6
Vim/usr/bin/yum, modify the first behavior #!/usr/bin/python2.6.6, avoid the later Yum use error.
Ln-s/opt/python2.7.6/bin/python/usr/bin/python
Ln-s/opt/python2.7.6/bin/python2.7/usr/bin/python2.7
Ln-s/opt/python2.7.6/lib/libpython2.7.so/lib64/libpython2.7.so
Ln-s/opt/python2.7.6/lib/libpython2.7.so.1.0/lib64/libpython2.7.so.1.0
The installation is complete and can be verified manually ~
Installing the Python Extender
Installing Setuptools
wget--no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz
Tar XF setuptools-1.4.2.tar.gz
CD setuptools-1.4.2
/opt/python2.7.6/bin/python setup.py Install
Install PIP
Go to download pip https://pypi.python.org/simple/pip/\ Copy the link inside pip9.01
wget--no-check-certificate https://pypi.python.org/packages/11/b6/ abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5= 35f01da33009719497f01a4ba69d63c9
Tar XF pip-9.0.1.tar.gz
CD pip-9.0.1
/opt/python2.7.6/bin/python setup.py Install
Make a soft connection
Ln-s/opt/python2.7.6/bin/pip/usr/bin/pip
/opt/python2.7.6/bin/pip Install URLLIB3
/OPT/PYTHON2.7.6/BIN/PIP Install Requests
/opt/python2.7.6/bin/pip Install ThreadPool
/opt/python2.7.6/bin/pip Install Pyopenssl
Installing Supervisor
/OPT/PYTHON2.7.6/BIN/PIP Install Supervisor
Ln-s/opt/python2.7.6/bin/supervisorctl/usr/bin/supervisorctl
Ln-s/opt/python2.7.6/bin/supervisord/usr/bin/supervisord
Start Supervisord
/opt/python2.7.6/bin/supervisord-c/etc/supervisord.conf
Python-2.7.6 Installation ~