linux安装更新Python

linux系统自带Python,此处只为更新Python


  1. 下载Python包

    wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz

  2. 编译Python

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

    make all

    make install

  3. 把系统自带的改名不然会有问题

    mv /usr/bin/python /usr/bin/python2.6.6

  4. 刚装的Python做软连接到此处

    ln -s /usr/local/python/bin/python /usr/bin/python

  5. 查看Python版本

    python -V

你可能感兴趣的:(python,更新安装)