centos reserved python2 installed under python3

1. Install depend on the environment

# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

 

2. Find what you need in python python official website, tar package to download to the local

# wget https://www.python.org/ftp/python/3.A.B/Python-3.A.B.tgz

 

3. Create a directory Python3

# mkdir /usr/local/python3 

 

4. Unzip the downloaded file and change directory

# tar -zxvf Python-3.A.B.tgz

# Cd Python-3.AB

 

5. Perform

# ./configure --prefix=/usr/local/python3

# make && make install

 

6. Create a soft link Python3

# ln -s /usr/local/python3/bin/python3 /usr/bin/python3

 

7. Create a soft link Pip3

# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

 

8. The test command and pip3 python3

# python3

# pip3

 

Install python command retains the original call python2

The installation is complete

1. Install depend on the environment

# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

 

2. Find what you need in python python official website, tar package to download to the local

# wget https://www.python.org/ftp/python/3.A.B/Python-3.A.B.tgz

 

3. Create a directory Python3

# mkdir /usr/local/python3 

 

4. Unzip the downloaded file and change directory

# tar -zxvf Python-3.A.B.tgz

# Cd Python-3.AB

 

5. Perform

# ./configure --prefix=/usr/local/python3

# make && make install

 

6. Create a soft link Python3

# ln -s /usr/local/python3/bin/python3 /usr/bin/python3

 

7. Create a soft link Pip3

# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

 

8. The test command and pip3 python3

# python3

# pip3

 

Install python command retains the original call python2

The installation is complete

Guess you like

Origin www.cnblogs.com/huchong/p/8688638.html