Install python3 (lazy version) under Linux

        Recently, I need to install python3, but after searching through Du Niang, there are always various problems after the installation is completed; today I accidentally found a very simple installation method, installed through miniconda, and then I will provide installation tutorials for my friends.

        1. First of all, my Linux system is centOS7.9 version, I think other versions support it

        2. Start the installation, download the miniconda installation package through the following command

#下载最新版本的miniconda安装包
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -P tools/

#若需安装指定版本,可去网站列表选择
https://repo.continuum.io/miniconda

Here we are going to demonstrate the installation of python3.7 version, so the command to download the installation package is as follows:

wget https://repo.continuum.io/miniconda/Miniconda3-py37_22.11.1-1-Linux-x86_64.sh -P tools/

        3. Install miniconda

#安装指定版本
bash tools/Miniconda3-py37_22.11.1-1-Linux-x86_64.sh -b

#安装最新版本
bash tools/Miniconda3-latest-Linux-x86_64.sh -b

        4. Initialize the miniconda environment

$HOME/miniconda3/bin/conda init

        5. Activate conda

bash

At this point, the installation is complete, but there are still some minor problems. Miniconda will open the virtual environment by default. Every time you enter the Linux terminal, it will automatically enter the virtual environment, so you need to modify it

Execute the following command to solve

conda config --set auto_activate_base false

To use python3 and pip3, you need to establish a soft connection, the command is as follows:

ln -s /root/miniconda3/bin/pip3 /usr/bin/pip3

ln -s /root/miniconda3/bin/python3 /usr/bin/python3

The author is installed under root by default, and all the installation is over, the effect is as shown in the figure:

         The above is all the installation content. It only takes six steps to complete the entire installation. Isn’t it very simple; if you have other questions, please leave a comment and leave a message, let’s discuss together

Guess you like

Origin blog.csdn.net/guo0208/article/details/128827393