CentOS7 安装Python3.6.8
2020-12-13 04:12
标签:版本 ln -s use 环境 The ecif uil RoCE url CentOS7 安装Python3.6.8 1. 安装依赖环境 yum -y groupinstall "Development tools" 2、下载Python3.6.8 新建个/usr/local/python3文件夹 (/usr/local/python3 ) 解压文件 3、安装Python3 创建安装文件的路径 4、编译(在解压的文件夹下 /usr/local/python3/python3.6.8) 5、安装(在解压的文件夹下 /usr/local/python3/python3.6.8) 6、创建新版本的软链接 修改旧版本 创建新的软连接 检查python的版本 7、配置成功后,pip3用不了,需要进一步配置 将/usr/local/python3/bin加入PATH 修改后如下: 复制代码 不过,由于yum是py2写的,所以更换完python路径后,yum可能会出现错误 把第一行python改为python2 CentOS7 安装Python3.6.8 标签:版本 ln -s use 环境 The ecif uil RoCE url 原文地址:https://www.cnblogs.com/klsw/p/11106166.htmlyum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
mkdir /usr/local/python3
在python3文件夹下下载安装包wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz
tar -xvf Python-3.6.8.tar.xz
mkdir /usr/local/python3
./configure --prefix=/usr/local/python3
make
make install # 先make再make install
mv /usr/bin/python /usr/bin/python_bak
mv /usr/bin/pip /usr/bin/pip_bakln -s /usr/local/python3/bin/python3 /usr/bin/python
ln -s /usr/local/python3/bin/pip3 /usr/bin/pippython -V
vim ~/.bash_profile
.bash_profile #Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/python3/bin
export PATH
保存退出后,执行以下命令,让上一步修改成功source ~/.bash_profile
完成!
所以要修改配置文件vim /usr/bin/yum
vim /usr/libexec/urlgrabber-ext-down