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
下载Python3
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
安装python3
mkdir -p /usr/local/python3
解压编译安装
tar -zxvf Python-3.7.0.tgz
cd Python-3.7.0
./configure --prefix=/usr/local/python3
make && make install
建立python3的软链
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
将/usr/local/python3/bin加入PATH
PATH=$PATH:$HOME/bin:/usr/local/python3/bin
setuptools
下载
wget https://files.pythonhosted.org/packages/d3/3e/1d74cdcb393b68ab9ee18d78c11ae6df8447099f55fe86ee842f9c5b166c/setuptools-40.0.0.zip
unzip setuptools-40.0.0
cd setuptools-40.0.0
安装
python3 setup.py build
python3 setup.py install
pip
下载pip
https://files.pythonhosted.org/packages/69/81/52b68d0a4de760a2f1979b0931ba7889202f302072cc7a0d614211bc7579/pip-18.0.tar.gz
解压
tar -zxvf pip-18.0.tar.gz
cd pip-18.0
安装
python3 setup.py build
python3 setup.py install
项目依赖
项目安装依赖
pip install -r requirements.txt
导出依赖
pip freeze > requirements.txt
本文链接地址: Linux 安装 python3.7&pip