cleanmymac3.9.6_源码包编译安装Python3.6

代码来源:cnblogs

原文作者:开始认识

原文链接:https://blog.csdn.net/qq_42353939/article/details/94609591

本文版权归原作者所有,如有侵权请立即与我联系,我将及时处理。

3933f21dec46119a84557e9922529a63.gif
1,安装Python3.6的依赖包# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel2.下载Python3# wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz3.安装python3创建目录:# mkdir -p /usr/local/python3  解压下载好的Python-3.x.x.tgz包(具体包名因你下载的Python具体版本不不同?而不不同,如:我下载的是Python3.6.1.那我这里就是Python-3.6.1.tgz)# tar -zxvf Python-3.6.1.tgz4.进入解压后的目录,编译安装。# cd Python-3.6.1# ./configure --prefix=/usr/local/python3  --with-ssl# make && make install5.建立python3的软链# ln -s /usr/local/python3/bin/python3 /usr/bin/python36.并将/usr/local/python3/bin加入PATH# vim ~/.bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/bin:/usr/local/python3/binexport PATH  按ESC,输入:wq回车退出。  修改完记得执行行下面的命令,让上一步的修改生效:# source ~/.bash_profile  检查Python3及pip3是否正常可用:# python3 -VPython 3.6.1# pip3 -Vpip 9.0.1 from /usr/local/python3/lib/python3.6/site-packages (python 3.6)

自动化安装脚本

#!/bin/bashyum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-develmkdir -p /usr/local/python3cd /mntwget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgztar -zxvf Python-3.6.1.tgzcd Python-3.6.1./configure --prefix=/usr/local/python3  --with-sslmake && make installln -s /usr/local/python3/bin/python3 /usr/bin/python3echo "PATH=$PATH:/usr/local/python3/bin"  >>/etc/profileecho "export PATH " >>/etc/profilesource /etc/profilepython3 -V
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值