Tutorial on installing and uninstalling python3 under Centos7

Tutorial on installing and uninstalling python3 under Centos7

1. Install Python 3

1. Install dependency packages yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc* make -y

2. Download the Python installation package wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz

The reason for downloading and installing python3.5.2 here is mainly because of the good stability of Django in the later stage.

3. Unzip the Python installation package tar -Jxvf Python-3.5.2.tar.xz

4. Configure the installation path

Go to the unzip directory

./configure prefix=/usr/local/python3

5. Compile and install

Go to the unzip directory

make && make install

6. Configure soft connection ln -s /usr/local/python3/bin/python3 /usr/bin/python3

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

Now you can use python3.5.2 and pip3 normally

It is found here that pip3 cannot be used after configuring soft link:

Solution:

[root@localhost bin]# which pip3 /usr/bin/pip3 [root@localhost bin]# pip3-bash: /usr/local/bin/pip3: no such file or directory [root@localhost bin]# type pip3 pip3 has been hashed (/usr/local/bin/pip3) [root@localhost bin]# hash -r [root@localhost bin]# type pip3 pip3 is /usr/bin/pip3 

7. Export the list of packages previously installed by Python in Windows

Open cmd and switch to the desktop

pip freeze > package.txt

Then import it into Centos7 and install the modules in the file with pip3

At this point, the functions and common modules in python3 have been installed and can be used normally

Uninstall python3

View the current Python version:

python -V

Note that when uninstalling, python is followed by 2 or 3 or nothing, otherwise all will be deleted.

Uninstall python3 rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps Uninstall pyhton3 whereis python3 |xargs rm -frv Delete all residual files Successfully uninstalled! whereis python View the existing installed Python

Summarize

The above is the tutorial on how to install and uninstall python3 on Centos7 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Centos8 (minimum installation) tutorial on how to install Python3.8+pip
  • Install the latest python3.8 under Centos7
  • Detailed steps to install python3.7 on CentOS6.5
  • Detailed tutorial on installing Python3 on CentOS7
  • Solution for not being able to use pip after installing python3.7.1 on centos6.5
  • Installation of python2.7.10 under Linux system (CentOS)
  • Tutorial analysis on installing Python3 under CentOS7

<<:  Detailed explanation of client configuration for vue3+electron12+dll development

>>:  The data folder failed to be created automatically during the installation of mysql8.0.14.zip. The service cannot be started.

Recommend

How to understand JavaScript modularity

Table of contents 1. Browser support 2. export ex...

Mini Program to implement Token generation and verification

Table of contents process Demo Mini Program Backe...

js realizes the function of clicking to switch cards

This article example shares the specific code of ...

Detailed discussion of the character order of mysql order by in (recommended)

//MySQL statement SELECT * FROM `MyTable` WHERE `...

MySQL/MariaDB Root Password Reset Tutorial

Preface Forgotten passwords are a problem we ofte...

Solution to mysql error code 1064

If the words in the sql statement conflict with t...

MySQL cross-database transaction XA operation example

This article uses an example to describe the MySQ...

Linux nohup to run programs in the background and view them (nohup and &)

1. Background execution Generally, programs on Li...

React sample code to implement automatic browser refresh

Table of contents What is front-end routing? How ...

MySQL 5.7.18 winx64 installation and configuration method graphic tutorial

The installation of compressed packages has chang...

The implementation process of Linux process network traffic statistics

Preface Linux has corresponding open source tools...

Installation and use of mysql on Ubuntu (general version)

Regardless of which version of Ubuntu, installing...