在Centos 5.{5,6} 安装Python 2.7

来源:互联网 发布:怎么找淘宝店铺微淘 编辑:程序博客网 时间:2024/06/11 19:54
1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930313233343536373839404142434445
# chmod +x install-python.sh# ./install-python.sh#!/bin/bash# Install necessary packagesyum -y install gcc gdbm-devel readline-devel ncurses-devel zlib-devel bzip2-develsqlite-devel db4-devel openssl-devel tk-devel bluez-libs-devel makecd /var/tmpwget http://sqlite.org/sqlite-amalgamation-3.7.3.tar.gztar xfz sqlite-amalgamation-3.7.3.tar.gzcd sqlite-3.7.3/./configuremakemake installcd /var/tmpwget http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgztar xvfz Python-2.7.1.tgzcd Python-2.7.1./configure --prefix=/opt/python2.7.1 --with-threads --enable-sharedmakemake installtouch /etc/ld.so.conf.d/opt-python2.7.1.confecho "/opt/python2.7.1/lib/" >> /etc/ld.so.conf.d/opt-python2.7.1.confldconfigln -sf /opt/python2.7.1/bin/python /usr/bin/python2.7cd /var/tmpwget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.eggsh setuptools-0.6c11-py2.7.egg --prefix=/opt/python2.7.1/opt/python2.7.1/bin/easy_install pipln -sf /opt/python2.7.1/bin/pip /usr/bin/pippip install virtualenvln -sf /opt/python2.7.1/bin/virtualenv /usr/bin/virtualenvecho "alias python=/opt/python2.7.1/bin/python" >> ~/.bash_profileecho "alias python2.7=/opt/python2.7.1/bin/python" >> ~/.bash_profileecho "PATH=$PATH:/opt/python2.7/bin" >> ~/.bash_profilesource ~/.bash_profile# Done
原创粉丝点击