python3.5.4安装_从头安装4 --python3环境

个人备注网页, 不喜勿扰

安装此部分功能时需要注意文件夹位置!!!!!

1.最小化安装的centos 有很多编译环境没有 需要安装

为了省事 可以全部安装

[root@base ~]# yum groupinstall -y "Development tools"

出现 :警告:分组 development 不包含任何可安装软件包。

执行 yum clean all 再执行上边的命令

[root@base ~]# yum install -y openssl-devel

[root@base ~]# yum install -y zlib

[root@base ~]# yum install -y zlib-devel

2.需要安装Python3.5

[root@base ~]# tar -zxf downloads/Python-3.5.3.tgz

[root@base ~]# cd Python-3.5.3/

[root@base Python-3.5.3]#./configure --prefix=/root/python3

[root@base Python-3.5.3]# make

[root@base Python-3.5.3]# make test

[root@base Python-3.5.3]# make install

[root@base Python-3.5.3]# cd /usr/bin

删除原有软连接

[root@base bin]# rm -rf python

[root@base bin]# ln -s /root/python3/bin/python3 ./python

[root@base bin]# ln -s /root/python3/bin/python3 ./python3

[root@base bin]# ln -s /root/python3/bin/pip3 ./pip3

3.验证是否成功

[root@base bin]# python

Python 3.5.3 (default, Aug 10 2017, 15:01:00)

[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>>

[root@base bin]# python3

Python 3.5.3 (default, Aug 10 2017, 15:01:00)

[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>>

[root@base bin]# pip3 list

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

pip (9.0.1)

setuptools (28.8.0)

4.yum 中需要修改部分头文件

[root@base bin]# vi yum

将第一行

!/usr/bin/python

修改为

!/usr/bin/python2.7

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值