嘉兴企业做网站,wordpress the_tag,服装网页设计网站,山东百度推广总代理文章目录 小结问题解决参考 小结 
在Red Hat 8.3中成功安装Python3.8.8和pip3。 
问题 
运行Python返回错误SyntaxError: future feature annotations is not defined#xff0c;发现的问题是程序要求Python3.8解释器#xff0c;然而现有安装版本是Python3.6。 
解决 
分别安… 文章目录 小结问题解决参考 小结 
在Red Hat 8.3中成功安装Python3.8.8和pip3。 
问题 
运行Python返回错误SyntaxError: future feature annotations is not defined发现的问题是程序要求Python3.8解释器然而现有安装版本是Python3.6。 
解决 
分别安装Python3.8.8和pip3步骤如下 
删除Python3.6 
[rootMaster ~]]# yum remove python36安装Python3.8和pip3 
[rootMaster ~]]# yum install python38
[rootMaster ~]]# yum install python38-pip 
设置默认Python和Pip版本 
[rootMaster ~]# cat ~/.bash_aliases 
alias python/usr/bin/python3.8
alias python3/usr/bin/python3.8
alias pip/usr/bin/pip3
[rootMaster ~]# source ~/.bash_aliases 
检查成功设置 
[rootMaster ~]# python
Python 3.8.8 (default, Aug 11 2021, 06:52:42) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] on linux
Type help, copyright, credits or license for more information.exit()
[rootMaster ~]# python -V
Python 3.8.8
[rootMaster ~]# python3 -V
Python 3.8.8
[rootMaster ~]# pip -V
pip 19.3.1 from /usr/lib/python3.8/site-packages/pip (python 3.8)
[rootMaster ~]# pip3 -V
pip 19.3.1 from /usr/lib/python3.8/site-packages/pip (python 3.8) 
参考 
How to make python3.7 default Red Hat: Chapter 38. Configuring the unversioned Python How to change python default version from 2.7 to 3.7 on RHEL 7 Setting the Default python to python3 How to install pip in RHEL 8 / CentOS 8 Stackoverflow: SyntaxError: future feature annotations is not defined [duplicate]