Install the Python environment on a new server. Installed before many times, but have not summed up, today need to reinstall, found or listen to a lot of, so decided to summarize, I hope the next time in the re-installation can be quickly done.
The first is to download python2.7, on the server, just use wget bar.
Download with this link, https://www.python.org/downloads/release/python-279/we need to be 2.7 version, so chose this. Select the source code in the tgz format to do so.
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
TAR-ZXVF your.tgz
CD Python-dir
./configure
Make
sudo make install
Problems may occur, depending on the prompt that appears, install the corresponding package is available.
After that, python2.7 should be installed under/usr/local/bin/python2.7. The problem now is that the original python of the system is 2.6, and the environment should be 2.6. However, this does not matter, when used, with the corresponding suffix can be.
Installing the Redis Extension
Https://pypi.python.org/packages/source/r/redis/redis-2.10.3.tar.gz
sudo python2.7 setup.py Install
Installing Pymongo
Download
Https://codeload.github.com/mongodb/mongo-python-driver/zip/master
sudo python2.7 setup.py Install
Installing Mysql-python
Download
wget https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5= 654f75b302db6ed8dc5a898c625e030c--no-check-certificate
Installation
Unzip Your.zip unzip the zip package.
python2.7 setup.py Build Compilation
sudo python2.7 setup.py Install
Test extensions
Import MySQLdb
Import Redis
Import Pymongo
If the module not found is not reported, it is proved to be available. If you need a different version, you can find the corresponding package, and the installation process is similar. There is time to specialize in the use of Easy_install installation method, today tried, but failed, the next special write again.
CentOS installation python and extension