下载Python二进制包
[root@openeuler ~]# wget https://mirrors.aliyun.com/python-release/source/Python-3.6.5.tgz
解压二进制包
[root@openeuler ~]# tar zxvf Python-3.6.5.tgz 
安装依赖包
[root@openeuler ~]# dnf install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libpcap-devel xz-devel libffi-devel
安装
[root@openeuler ~]# cd Python-3.6.5/
[root@openeuler Python-3.6.5]# ./configure --prefix=/usr/local/python3
[root@openeuler Python-3.6.5]# make && make install
配置软件链接
[root@openeuler Python-3.6.5]# ln -s /usr/local/python3/bin/python3.6 /usr/bin/python

[root@openeuler Python-3.6.5]# ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip
ln: 无法创建符号链接 '/usr/bin/pip': File exists
# 如果遇到此问题把已存在文件删掉即可
[root@openeuler Python-3.6.5]# rm -rf /usr/bin/pip
[root@openeuler Python-3.6.5]# ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip
验证
[root@openeuler Python-3.6.5]# python -V
Python 3.6.5
[root@openeuler Python-3.6.5]# pip -V
pip 9.0.3 from /usr/local/python3/lib/python3.6/site-packages (python 3.6)
测试
[root@openeuler ~]# echo "print('Hello World')" > hello.py  
[root@openeuler ~]# python hello.py                       
Hello World