Python--Linux上安装Python
软件下载
官网下载:https://www.python.org/downloads/
详细操作步骤
1、安装相关插件
[root@bJ ~]# yum install zlib-devel openssl openssl-devel gcc sqlite-devel
2、安装python
# wget https://repo.huaweicloud.com/python/3.9.5/Python-3.9.5.tgz
# tar xvzf Python-3.9.5.tgz
# cd Python-3.9.5/
# ./configure --prefix=/usr/local/python3.9
# make && make install
3、安装完成后做个软链接方便调用
# ln -s /usr/local/python3.9/bin/python3.9 /usr/local/bin/python3 # ln -s /usr/local/python3.9/bin/pip3.9 /usr/local/bin/pip3
4、测试是否安装成功
# python3 Python 3.9.5 (default, Jun 7 2021, 15:11:39) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print(1111) 1111
人生是条无名的河,是浅是深都要过;
人生是杯无色的茶,是苦是甜都要喝;
人生是首无畏的歌,是高是低都要唱。