本文主要是介绍linux 安装python3环境,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
先安装python所需要的依赖
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
下载python安装包
wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
在user/local/创建python3文件 并解压python3的压缩包解压到当前文件夹
mkdir -p /usr/local/python3
tar -zxvf Python-3.8.1.tgz
安装Gcc和openssl依赖
yum install gcc
yum install libffi-devel -y
配置并安装
cd Python-3.8.1
./configure --prefix=/usr/local/python3
make && make install
配置python3和pip软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
查看python3和pip3是否配置好
python3
pip3
linux安装pip
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python get-pip.py
这篇关于linux 安装python3环境的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!