Home  >  Article  >  Topics  >  How to solve the problem that Pagoda cannot be run after installing python3

How to solve the problem that Pagoda cannot be run after installing python3

藏色散人
藏色散人forward
2020-12-07 13:51:273768browse

The following tutorial column of Pagoda will introduce to you the solution to the problem that Pagoda cannot run after installing python3. I hope it will be helpful to friends in need!

How to solve the problem that Pagoda cannot be run after installing python3

Solution to Pagoda that cannot be run after installing python3

First of all, many friends in the forum said that their Linux The system needs to install python3, so Xiaoqiang is here to teach you an installation environment that can use both python3 and python2.

I originally came up with a script, but thinking about how to support so many versions, I panicked a little .

Then install a python3 first. My environment is Centos7.4 64-bit. Next time I will release an Ubuntu one. Anyway, it is almost the same for now and only supports Centos for the time being.

After installing the pagoda The gcc make environment is already installed. No more introduction here. Let’s get straight to the point

1. Download the python installation package

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

2. Unzip

  tar -xzvf Python-3.6.0.tgz

3. Enter the path to the decompressed installation package:

  cd Python-3.6.0

4. Compile the installation package, specify the installation path, and execute the installation command:

Note: The prefix parameter is used to specify that Python is installed in a new directory to prevent overwriting the python installed by default on the system

./configure --prefix=/usr/local/python36   
make && make install

5. Establish a soft link (python3 environment variable)

ln -s /usr/local/python36/bin/python3.6 /usr/bin/python3

You can use python3 by running python3 directly

[root@Rserver-1 Python-3.6.0]# python3
Python 3.6.0 (default, May 25 2017, 11:39:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>>
>>>

If you accidentally set python3 as the default py, the solution is as follows:

wget http://103.224.251.67/install/ext/python_check.sh && sh python_check.sh

For more related technical articles, please visit the Pagoda Paneltutorial column!

The above is the detailed content of How to solve the problem that Pagoda cannot be run after installing python3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:bt.cn. If there is any infringement, please contact admin@php.cn delete