【Python】Centos7安装Python3和pip

安装Python3

# wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
# tar -xvJf  Python-3.6.2.tar.xz
# cd Python-3.6.2
# ./configure --prefix=/datas/soft/python3
# make && make install
# ln -s /datas/soft/python36/bin/python3 /usr/bin/python3
# ln -s /datas/soft/python36/bin/pip3 /usr/bin/pip3

 

使用pip安装报错

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

 

解决方法:

# mkdir -p ~/.pip
# vim ~/.pip/pip.conf

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host = mirrors.aliyun.com

 

posted @ 2022-10-16 21:27  蓝色星辰1993  阅读(74)  评论(0编辑  收藏  举报