Python 自动化运维1-Python安装

时间:2022-12-21 20:33:59

Python安装

1.下载Python2.7源安装包:

  wgethttps://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz

2.解压安装包:

  tar -zxvf Python-2.7.12.tar.xz  

3.切换至python目录下

  cd Python-2.7.12/

4.安装readline-devel包

  yum install readline-devel

5.使用configure创建makefile

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

  make && make install

6.将Python2.7程序通过软连接到/usr/bin/Python2.7环境变量中

  ln -sv /usr/local/python27/bin/python2.7 /usr/bin/python2.7