Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simply-static domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121
再Centos7上安装python3

再Centos7上安装python3

第一步:安装相关依赖包和编译环境

$>yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel gcc

(注意:这一步很重要,如果不安装相关依赖包,在使用pip安装python包时会报找不到SSL错误!)

第二步:下载python3.8.0安装包

$>wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tar.xz

第三步:解压安装包并创建安装目录

$>xz -d Python-3.8.0.tar.xz

$>tar -xvf Python-3.8.0.tar

$>mkdir /usr/local/python3.8.0

第四步:编译安装

$>cd Python-3.8.0

$>./configure –with-ssl –prefix=/usr/local/python3.8.0

(注意:prefix后面配置第三步中创建的路径,且等号两边不能有空格,不然会报错)

$>make && make install

第五步:创建python3.6.5软链接

$>ln -s /usr/local/python3.8.0/bin/python3.8 /usr/bin/python3

$>ln -s /usr/local/python3.8.0/bin/pip3.8 /usr/bin/pip3

$>pip3 install –upgrade pip(升级pip3)

第六步:修改python2.7.5软链接(这一步可有可无)

$>mv /usr/bin/python /usr/bin/python2

第七步:验证,使用python3进入python3.8.0命令行

$>python3