Python在centos中的各版本并存安装
1 安装依赖 yum install -y gcc openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel tk-devel libffi-devel zlib-devel 2 下载安装包(https://www.python.org/ftp/python中选版本就行,这里以3.9版本为例子) wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz 3 解压并安装(安好后,其安装目录下会有bin目录,bin里面就是python执行文件) tar -xvf Python-3.9.0.tar.xz cd Python-3.9.0 ./configure prefix=/opt/python3.9 make && make altinstall // make altinstall 不会创建软链和手册相关信息,这便是共存的关键 4 建立软连接(可选) ln -s /opt/python3.9/bin/python3.9 /usr/bin/python3.9 ln -s /opt/python3.9/bin/pip3.9 /usr/bin/pip3.9
发布者:songJian 点击数:545 发布时间:2024-02-19 17:53:27 更新时间:2024-02-24 20:02:59
正在加载评论...