ubuntu系统下git和python3的下载和安装

ubuntu系统下git和python3的下载和安装

安装git

sudo apt install git

下载Python3

cd Downloads
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz

解压Python3

tar xvf Python-3.7.1.tgz

编译与安装Python3

./configure
sudo make install

执行./configure在 检查configure执行的过程一定要检查一下配套的组件都足够的齐全,比如说需要通过python去下载一个https的文件,所以现在编译python的过程中必须要拥有openssl 支持。
在这里插入图片描述
如上图就不需要安装openSSL依赖工具,如果显示是no就需要安装依赖工具

安装python3 依赖工具

 sudo apt install git-core libssl-dev libffi-dev gnupg flex bison gperf build-essential zip curl zlib1g-dev
gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev libz-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip

因为Ubuntu系统默认已经安装了python2.7 ,下载Android 源码用python3,编译Android源码需要python2,所以我们就需要有一个管理python版本来管理python

python 管理

配置update-alternatives
 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2
sudo update-alternatives --install /usr/bin/python python python3的安装地址(/usr/local/bin/python3.7) 3(权重号)
选择Python版本

sudo update-alternatives --config python
最后执行python --version 就可以看到执行的python3 的版本

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值