程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Series for busy people: Python installation under Linux

編輯:Python

Linux Next Python install

System environment :centos 7.6

Python edition :Python-3.6.8

1. Environment depends on

Python3.x The installation of depends on these four components :gcc, zlib,zlib-devel,openssl-devel; So it needs to be pre installed , The order is as follows :

yum install gcc -y
yum install zlib -y
yum install zlib-devel -y
yum install openssl-devel -y

2. Download and compile

Python Source package download address : https://www.python.org/downloads/

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

3. Decompress and compile

# tar -zxvf Python-3.6.8.tgz

Enter the root directory to compile , You can specify the path to compile and install , Here we designate as /usr/app/python3.6

# cd Python-3.6.8
# ./configure --prefix=/usr/app/python3.6
# make && make install

4. Environment variable configuration

vim /etc/profile
export PYTHON_HOME=/usr/app/python3.6
export PATH=${PYTHON_HOME}/bin:$PATH

Make the configured environment variables take effect immediately :

source /etc/profile

5. Verify that the installation was successful

Input python3 command , If you can get into python Interactive environment , The installation is successful :

[[email protected] app]# python3
Python 3.6.8 (default, Mar 29 2019, 10:17:41)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+1
2
>>> exit()
[[email protected] app]#


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved