centos上安装 Python3.xx
- 下载源码包
wget wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.gz
2. 安装依赖
yum install -y openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
3. 安装
tar zxf Python-3.6.1.tar.gz cd Python-3.6.1 ./configure --prefix=/usr/local/python3 make make install
4. 设置环境变量,方便使用
# 进入python解析器 ln -s /usr/local/python3/bin/python3 /usr/bin/python3 # pip 安装包工具 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
安装完成,可以使用了
时间: 2024-10-08 03:44:20