期盼死亡的小丑 发表于 2018-8-5 07:32:11

Centos7下python2.x 和python3.x共存

# 解压  root@pts/0 $ tar -zxf Python-3.6.1.tgz
  root@pts/0 $ ll
  总用量 26112
  drwxr-xr-x 17501501   4096 3月21 2017 Python-3.6.1
  -rw-r--r--1 root root 22540566 3月21 2017 Python-3.6.1.tgz
  # 编译
  默认会被安装到 /usr/local下面。这里我们通过configure的--prefix参数自定义安装路径,方便以后的卸载
  root@pts/0 $ cd Python-3.6.1
  root@pts/0 $./configure --prefix=/usr/local/python3
  checking build system type... x86_64-unknown-linux-gnu
  checking host system type... x86_64-unknown-linux-gnu
  checking for python3.6... no
  checking for python3... no
  checking for python... python
  checking for --enable-universalsdk... no
  checking for --with-universal-archs... no
  checking MACHDEP... linux
  checking for --without-gcc... no
  checking for --with-icc... no
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  # 安装
  root@pts/1 $ make && make install
页: [1]
查看完整版本: Centos7下python2.x 和python3.x共存