微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。