CenOS7
- 安装依赖环境
yum -y install openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc
- 编译安装python3
tar zxvf Python-3.5.3.tgz && cd Python-3.5.3
./configure
make && make install
- 安装完成默认有
pip3
[root@ci-host Python-3.5.3]# whereis pip3
pip3: /usr/local/bin/pip3 /usr/local/bin/pip3.5
如果安装pyhon3提示
pip is configured with locations that require TLS/SSL....
是因为没有安装openssl-devel
. 从第一步走一遍
CenOS安装python3.6 (tar.xz)
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
tar -xvJf Python-3.6.5.tar.xz && cd Python-3.6.5
./configure prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python36/bin/pip3 /usr/bin/pip3
pip3 install -U pip
yum 安装
现在的epel.repo源中加入了Python36, 可以直接用yum安装
- 增加
epel.repo
源 yum install python36 python36-devel python-setuptools
python36
- 安装
pip3
$ sudo easy_install-3.6 pip -i https://pypi/douban.com/simple
$ whereis pip3
pip3: /usr/local/bin/pip3 /usr/local/bin/pip3.6