一版linux 会自带一个python2.X的版本,不用管它,也不用改配置
因为用到了pip,(pip依赖ssl环境)
yum -y install openssl*
python安装步骤
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
tar xf Python-3.6.3.tgz
cd Python-3.6.3/
./configure --with-ssl
make && make install
ln -s /usr/local/bin/python3.6 /usr/bin/python3
这个时候python3安装好了,默认pip3也安装成功,运行以下命令不报错就是成了
python3 -V
pip3
如果使用pip3安装插件的时候提示:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
是因为系统缺少openssl-devel包
yum install openssl-devel -y 安装一下即可.
再按照上面的方法重新 编译一下即可.
参考文章:
https://www.cnblogs.com/wayde-Z/p/6086083.html
http://www.runoob.com/python/python-install.html