专栏首页python3Python3 与 Python2共存

Python3 与 Python2共存

Python3 与 Python2共存

  1. 查看当前python版本 python --version
  2. 备份python which python mv /usr/bin/python /usr/bin/python.bak
  3. 下载安装更新python3 wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz tar -xvJf Python-3.6.2.tar.xz
  4. 安装关联程序,安装编译python3 yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make cd Python-3.6.2 ./configure prefix=/usr/local/python3 make && make install ln -s /usr/local/python3/bin/python3 /usr/bin/python
  5. 查看python版本 python --version
  6. 修改相关执行程序python版本 vi /usr/bin/yum 把#! /usr/bin/python修改为#! /usr/bin/python2 vi /usr/libexec/urlgrabber-ext-down 文件里面的#! /usr/bin/python 也要修改为#! /usr/bin/python2

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • centos7下Python和pytho

    一、python3.7.3安装 1、下载对应的版本https://www.python.org/downloads/source/ 2、安装依赖的包 yum i...

    py3study
  • CentOS 7下安装Python3.6

    yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqli...

    py3study
  • centos上安装 Python3x

    py3study
  • centos7下Python和pytho

    一、python3.7.3安装 1、下载对应的版本https://www.python.org/downloads/source/ 2、安装依赖的包 yum i...

    py3study
  • Linux下python2升级到pyth

    https://www.cnblogs.com/liuliu3/p/6920927.html

    py3study
  • linux下安装Python-2.7.9

    py3study
  • python2.7安装

     wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz

    py3study
  • 在安装Python时报错

    首先下载tar包 地址  http://www.python.org/ftp/python

    py3study
  • centos7.3更换python版本-

    此时需要修改usr/libexec/urlgrabber-ext-down和/usr/bin/yum两个文件

    py3study
  • Linux下安装Python-3.5.0

    # wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz

    py3study

扫码关注云+社区

领取腾讯云代金券