Install python environment under Linux

Description: Centos7 environment used in this article

Sometimes our projects need to be run under Linux. Linux comes with python2, so the python3 environment must be reinstalled. Remember not to change the original python2 environment (Linux system depends on this environment).

1. View current python environment version

python --version

2. First install the dependency packages needed for compiling and installation. When compiling the python source code, some dependency packages are required, and the installation is completed at one time

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel

**3. Download the corresponding Python version as needed: **

When the server download is slow, you can upload it to the server after the official website is downloaded locally.

https://www.python.org/ftp/python/3.7.2/

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

4. Unzip the python installation package

cd opttar -zxvf Python-3.7.2.tgz

5. Create a new python3 installation directory

mkdir -p /usr/local/python3

6. Compile and install

cd Python-3.7.2/./configure --prefix=/usr/local/python3make && make install

7. Add soft connection

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

8. Verify that the installation is successful

python3 --versionpip -V

Recommended Posts

Install python environment under Linux
Install python3.6 under Ubuntu 16.04
Install python3 on linux, keep python2
Install MySQL under Linux (CentOS 7)
CentOS 6.8 under linux install mongodb
Install Python3 and ansible under CentOS8
Install Python virtual environment on Ubuntu 18.04
Install Python3 and Py under CentOS7
Centos6 install Python2.7.13
Centos7 install Python 3.6.
ubuntu18.04 install python2
CentOS install Python 3.6
ubuntu12.04 install python3
Install linux (ubuntu) dual system under windows system
Centos7 install Python2.7
Install mysql8.0.13 version under Linux CentOS7 system
Linux01 install centOS6.5mini
Centos install Python3
Build a python development environment under Ubuntu
CentOS6.8 install python2.7
ubuntu18.04 install python
Ubuntu20.04 install Python3 virtual environment tutorial detailed explanation
How to install vim editor under Linux (Ubuntu 18.04)
How to install python in ubuntu server environment
Install Python3 environment in a brand new Ubuntu
Install apache+PHP under Ubuntu
Install node.js under Ubuntu
Install mysql5.7 under CentOS7
Install mysql under Ubuntu 16.04
Install Thrift under ubuntu 14.10
Install ActiveMQ under Centos7
Install OpenJDK10 under Ubuntu
Install Caffe under Ubuntu 14.04
Python MySQLd under Ubuntu
Install PostgreSQL12 under CentOS7
Install CentOS under VMware
linux install snmp service-ubuntu
[python] python2 and python3 under ubuntu
Linux Centos7 install jdk1.8
2018-09-11 Install arduino under Ubuntu
CentOS (linux) install PostgreSQL
Install Python3 on Ubuntu 14.04
Python virtual environment: Ubuntu16.04
Centos6.9 install npm environment
Install mysql under Centos 7
Install Jenkins under Centos 7
Install python in Ubuntu
Install Python3 on Ubuntu 16.04
Install ROS under ROS Ubuntu 18.04[2]
Install MariaDB under MariaDB Centos7
Install mysql5.1 under CentOS6.5
Install MySQL under Ubuntu
Install Yarm-PM2 under Ubuntu
Install Python3.7 on Ubuntu
Centos 7 install JDK (Linux install jdk)
Compile and install Lnmp shell script under Linux centos
Resolve the problems encountered in the linux environment under ubuntu
[CentOS environment deployment] Java7/Java8 deployment under CentOS
Django&MySQL environment deployment under Ubuntu 14.04
Python introduction and environment installation
Build docker environment under Centos6.5