Centos7 Python3 和pip3 pip 安装

最小化安装的Centos7  需要安装pip

yum install python-pip

没有的化可以先运行 yum install epel-release

版本查看 pip -V

先安装几个必要包python3 和pip3 用到

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

创建python3目录

mkdir /usr/local/python3    #类似Windows的安装目录

进入local 目录     cd /usr/local

wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz

解压命令  tar -xvf Python-3.6.5.tgz

进入解压文件夹配置安装目录

cd Python-3.6.5

./configure --prefix=/usr/local/python3

make

make install

配置python3  pip3 软链接

ln -s /usr/local/python3/bin/python3 /usr/bin/python3

ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

查看是否安装成功

python3 -V

pip3 -V




你可能感兴趣的:(Linux)