现在好多人都不会用centos6.5安装python3,现在演示一下源码编译
[root@cent7_6 ~]$cat install_python3.sh
#!/bin/bash
#
#********************************************************************
#Author: yzl
#QQ: calm_yzl@163.com
#Date: 2021-10-22
#FileName: install_python3.sh
#URL: yzil.cn
#Description: The test script
#Copyright (C): 2021 All rights reserved
#********************************************************************
cd /usr/local/src/
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar -xzvf Python-3.6.0.tgz
mkdir /usr/local/python3
cd Python-3.6.0
./configure --prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
python3 -V
chmod 777 -R /usr/local/python3/
whereis python
rm -rf /usr/bin/python
ln -s /usr/local/python3/bin/python3 /usr/bin/python
[root@cent7_6 ~]$python
Python 3.6.0 (default, Oct 22 2021, 09:12:15)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
|