centos7 没有 pip
先安装 pip
yum install epel-release
yum install -y python-pip
推荐使用 pyenv
不推荐源码安装
查找 python 官网包链接:
https://www.python.org/downloads/
找个地方下载安装包, 执行比如:wget
https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
解压安装包tar xvf [包名]
进入解压后的包 设置安装python目录, 例如:./configure --prefix=/usr/local/python3
编译:make
安装:make install
关联命令 比如 python37(/usr/local/python3/bin/python3):ln -s [安装后python路径] /usr/bin/python37
关联 pip3ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3