linux 安装python3.x

原创
2020/07/31 22:45
阅读数 14

1.更新及安装依赖包
sudo apt update
sudo apt install -y make build-essential libssl-dev zlib1g-dev
sudo apt install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm
sudo apt install -y libncurses5-dev libncursesw5-dev xz-utils tk-dev


2.下载python-3.7.4.tgz 包并编译安装
tar xvf Python-3.7.4.tgz
cd Python-3.7.4
./configure --enable-optimizations

3.运行以下命令编译安装
make -j4 && sudo make altinstall
sudo make clean

#===============

centos7 安装python3
1.
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel zlib* gcc

2.
wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz
tar zxvf Python-3.6.8.tgz

3.
cd Python-3.6.8
./configure --prefix=/usr/local/python3
make && make install
make clean

4.根据需要
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部