I installed a centos 6.9 today, check that the default python version is 2.6, so I am ready to upgrade, follow the previous upgrade steps on ubuntu:
(1) wget http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tgz
(2) tar -xzvf Python-3.3.0.tgz
(3) mkdir /usr/local/python
(4) ./configure --prefix=/usr/local/python3
A prompt appeared in the fourth step:
It turns out that the C compiler is missing and the GCC suite needs to be installed, so install it with the following command,
(5) yum -y install gcc
Successfully downloaded and installed successfully, repeat the fourth step command: ./configure --prefix=/usr/local/python3 Successfully configured
(6) make
make install
(7) mv /usr/bin/python /usr/bin/python_old2
(8) ln -s /usr/local/python3/bin/python3/usr/bin/python
Recommended Posts