How to install python3 on linux

藏色散人
Release: 2019-10-19 11:23:00
Original
8103 people have browsed it

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
Copy after login

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
Copy after login

3. Create the path to the installation file.

mkdir /usr/local/python3
Copy after login

4. Compile.

./configure --prefix=/usr/local/python3
Copy after login

(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
Copy after login

2. Create a new soft link

ln -s /usr/local/python3/bin/python3 /usr/bin/python
Copy after login

3. Check the python version

python -V
python-3.6.0
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!