CentOS安装Python3

安装依赖包

  yum -y groupinstall development

  yum install -y libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel

下载tgz包并解压

  tar xf Python-3.x.x.tgz

进入解压后文件夹

  cd Python-3.x.x

配置安装路径并安装

  ./configure --prefix=/usr/local/python3

  make && make install

添加环境变量

  cd /etc/profile.d

  echo 'export PATH=$PATH:/usr/local/python3/bin/' > python3.sh

上一篇:Linux解压文件到指定目录


下一篇:新晋程序员不知道的25个编程小技巧,知道它们,能让你事半功倍