menu Chancel's Blog
rss_feed lightbulb_outline

Linux编译安装Python

类型:Linux
创建时间:2021-06-15 17:04:10
更新时间:2021-06-15 17:04:10
类型:Linux
更新时间:2021-06-15 17:04:10

首先准备安装环境

# 编译依赖项目
sudo apt install libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev zlib1g-dev make gcc

# 用于编译过程的缓存文件夹
mkdir /tmp/python3/
cd /tmp/python3/

在Python官网选择合适的安装包,我这里选择的是Python3.7版本(下载地址)

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

下载并解压

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

选择安装目录并编译,我这里选择安装在 /usr/local/python3.7

./configure --prefix=/usr/local/python3.7
sudo make
sudo make install

最后,如有需要请添加到系统环境中(Path)中

sudo ln -s /usr/local/python3.7/bin/python3 /usr/bin/python3.7

[[replyMessage== null?"发表评论":"@" + replyMessage.m_author]]

account_circle
email
web_asset
textsms

评论列表([[messageList.data.items.length]])

[[messageItem.m_author]] [[messageItem.m_author]]
[[messageItem.create_time]]
[[messageItem.m_environ.browser]] [[messageItem.m_environ.os]] [[messageItem.m_environ.device]]
[[subMessage.m_author]] [[subMessage.m_author]] @ [[subMessage.parent_message.m_author]] [[subMessage.parent_message.m_author]]
[[subMessage.create_time]]
[[subMessage.m_environ.browser]] [[subMessage.m_environ.os]] [[subMessage.m_environ.device]]