linux python3安装

1.下载安装包

[root@iZuf6a9cdcuwzty057~]# mkdir -p /opt/python3 
[root@iZuf6a9cdcuwzty057~]# cd /opt/python3/ 
[root@iZuf6a9cdcuwzty057 python3]# wget  https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz 
[root@iZuf6a9cdcuwzty057 python3]# tar -xvf Python-3.7.0.tar.xz 
[root@iZuf6a9cdcuwzty057 python3]# cd Python-3.7.0/ 

2.编译安装

[root@iZuf6a9cdcuwzty057 Python-3.7.0]# ./configure --prefix=/usr/local/python3 
[root@iZuf6a9cdcuwzty057 Python-3.7.0]# make && make install

--prefix参数指定了软件的安装目录,该软件所有的安装文件都被复制到这个目录,其好处是方便我们卸载或移植软件,推荐使用。

3.新建软连接

[root@iZuf6a9cdcuwzty057 Python-3.7.0]# ln -sv /usr/local/python3/bin/python3.7.0 /usr/bin/python

输入python

[root@iZuf6a9cdcuwzty057 opt]# python
Python 3.7.0 (default, Dec 24 2021, 10:47:46) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

pip版本升级

python -m pip install --upgrade pip

官网https://pip.pypa.io/en/stable/installation/icon-default.png?t=LA92https://pip.pypa.io/en/stable/installation/

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值