文章目录
零、前言
为什么需要使用源码编译安装?
使用apt-get下载验证python3安装时,(sudo apt-get install python3) 你可能会看到python3 is already the newest version (3.5.1-3)。即你提供的仓库中不存在更高版本或者通过apt-get暂时只能安装这么高的版本。
如果你没看到这个提示,那么就可能单纯是你的仓库中没有这个版本的python,可以如下操作:
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
或者add-apt-repository ppa:jonathonf/python-3.7
apt-get update
apt-get install python3.7
或者尝试添加软件源:
vi /etc/apt/sources.list
# 阿里云的软件源
deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse
#ubuntu 有科学上网可以加上,否则太慢,没用
# deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
# deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
# deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
# deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http

该文详细介绍了在Ubuntu系统中,当通过apt-get无法获取所需Python版本时,如何通过源码编译方式安装Python3.7.1。首先,文章强调了在编译安装前需要进行时间同步和安装cmake,接着讲解了下载Python源码包、配置编译选项、安装及验证过程。此外,还提到了配置环境变量和管理pip下载源的重要步骤。
、包含cmake完整安装流程(主要适用于arm linux机器)&spm=1001.2101.3001.5002&articleId=129138259&d=1&t=3&u=cb000c304c9d41f6b2c658932f9a9711)
1万+

被折叠的 条评论
为什么被折叠?



