centos6.8 安装 Python2.7.x

前端之家收集整理的这篇文章主要介绍了centos6.8 安装 Python2.7.x前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

centos6.8

自带的python2.6.x,但是不能用pip,安装到 Python2.7 版本

wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
xz -d Python-2.7.15.tar.xz
tar -xvf Python-2.7.15.tar.xz
cd Python-2.7.15.tar
./configure
make
make install
cd ~
python -V

安装完毕!

[root@bandwagon ~]# python -V
Python 2.7.15

[root@bandwagon ~]# ll /usr/local/bin/py*
-rwxr-xr-x 1 root root      84 Jul  3 03:25 /usr/local/bin/pydoc
lrwxrwxrwx 1 root root       7 Jul  3 03:26 /usr/local/bin/python -> python2
lrwxrwxrwx 1 root root       9 Jul  3 03:26 /usr/local/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 4723927 Jul  3 03:26 /usr/local/bin/python2.7
-rwxr-xr-x 1 root root    1687 Jul  3 03:26 /usr/local/bin/python2.7-config
lrwxrwxrwx 1 root root      16 Jul  3 03:26 /usr/local/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root      14 Jul  3 03:26 /usr/local/bin/python-config -> python2-config
[root@bandwagon ~]#

安装 pip

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -i epel-release-latest-6.noarch.rpm
yum install python-setuptools # 这一步可以省略
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
原文链接:https://www.f2er.com/centos/374151.html

猜你在找的CentOS相关文章