Home  >  Article  >  Backend Development  >  How to install python3 on linux

How to install python3 on linux

藏色散人
藏色散人Original
2019-10-19 11:21:528099browse

How to install python3 on linux

How to install python3 on Linux?

Configure and install python3 under Linux

1. First, download the required version of python3 from the official website.

Recommended: "python tutorial"

(1) Method 1

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

If you want to download to that folder, enter that folder first Next——cd /home/download

(2) Method 2

After downloading the compressed package from the official website, place it in the main folder

2. Then, Unzip the file》

tar -xvf Python-3.6.0.tgz -C /usr/local

3. Create the path to the installation file.

mkdir /usr/local/python3

4. Compile.

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

(The path at this time should be under Python-3.7.0)

5. Installation.

1, make

2, make install

3, completed

(The path at this time should be under Python-3.7.0)

6. Create a new version of the soft connection.

1. Modify the old version

mv /usr/bin/python /usr/bin/python_bak

2. Create a new soft link

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

3. Check the python version

python -V
python-3.6.0

Soft link created successfully

The above is the detailed content of How to install python3 on linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn