CentOS6 安装 Python2.7

安装咗好多次,安都安到烦,记一记安装过程,下次冇咁烦。

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

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
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/bin
sudo ln -s /usr/bin/python2.7 /usr/bin/python27
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
sudo python2.7 setup.py install

sudo /usr/local/python2.7/bin/easy_install pip
#OK

sudo /usr/local/python2.7/bin/pip install mysql-python
发布了57 篇原创文章 · 获赞 13 · 访问量 7万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览