centos 如何安装 python3

centos 如何安装 python3

安装wget

yum -y install wget

使用wget下载python源代码编译并安装

  1. 使用wget下载python源代码 :wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tar.xz(这里以python3.5为例);
  2. 解压xz文件 :xz -d Python-3.5.0.tar.xz;
  3. 解压tar文件 :tar -xf Python-3.5.0.tar;
  4. 配置:进入解压后的文件夹 执行命令 ./configure perfix=/usr/local/python3;
  5. .第4步骤可能会报错:缺少gcc,安装gcc:yum -y install gcc
  6. .编译安装:make&&make install

猜你喜欢

转载自blog.csdn.net/qq_15098623/article/details/90943248