The first step is to check the version number and installation path of Python; From the above view, we can see that python points to python2 by default, so we don’t change it here and just keep the current state. Note: (Because there are still many system updates that require the use of pyhton2, such as: Centos7 yum installation and update. Frameworks such as Django now use python3 by default) The second step is to install the related dependency libraries of python3. 1. Install dependencies that may be used by python3.7 yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel wget yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc yum -y install libffi-devel 2. Download Python 3 cd /tmp/ wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz 3. Unzip the downloaded compressed package tar -zxvf Python-3.7.4.tgz 4. Configure and compile mkdir /usr/local/python3 cd Python-3.7.4/ ./configure --enable-shared --prefix=/usr/local/python3 --enable-optimizations make make install Step 4: After the installation is complete, create a soft link Later use is to directly enter python and run python2. Enter python3 to run pyhton3. cd /usr/local/python3/bin/ ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3 pip3 install --upgrade pip This step may result in the following error: Error message:
Solution: (Enter the installation directory and copy the file) cd /tmp/Python-3.7.4/ cp libpython3.7m.so.1.0 /usr/local/lib64 cp libpython3.7m.so.1.0 /usr/lib/ cp libpython3.7m.so.1.0 /usr/lib64/ Step 5. Complete all installations and create a Python virtual environment for the next update Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Practical Optimization of MySQL Paging Limit
>>: MySQL scheduled task example tutorial
Table of contents 1. Structural instructions Modu...
Table of contents 1. Characteristics of JS 1.1 Mu...
1. Discover the problem © is the copyrigh...
1. Introduction to DockerUI DockerUI is based on ...
First of all, we know that this effect should be ...
It seems that the mysql-sever file for installing...
This article example shares the specific code of ...
This article shares the specific code for impleme...
How to solve the timeout problem when pip is used...
MySQL implements Oracle-like sequences Oracle gen...
Introduction: In many cases, many people think th...
Sublime Text 2 is a lightweight, simple, efficien...
This article summarizes the knowledge points of M...
Table of contents Preface Reference Comparison Ma...
The following questions are all based on the Inno...