歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

CentOS6安裝Python2.7

sudo yum -y install python-devel openssl openssl-devel gcc sqlite-devel

wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar -xvjf Python-2.7.6.tar.bz2
cd Python-2.7.6
./configure --prefix=/usr/local/python2.7 --with-threads --enable-shared
sudo make
sudo make install altinstall
sudo ln -s /usr/local/python2.7/lib/libpython2.7.so /usr/lib
sudo ln -s /usr/local/python2.7/lib/libpython2.7.so.1.0 /usr/lib
sudo ln -s /usr/local/python2.7/bin/python2.7 /usr/local/bin
sudo /sbin/ldconfig -v

# OK
python2.7 -V 

裝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 distribute-0.6.49
python2.7 setup.py install

sudo /usr/local/python2.7/bin/easy_install pip
#OK
/usr/local/python2.7/bin/pip install xxx
Copyright © Linux教程網 All Rights Reserved