pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail

  找公司新开了一个云主机CentOS release 6.8,pip3安装库的时候报pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

python3 -m pip install markupsafe
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting markupsafe
  Could not fetch URL https://pypi.python.org/simple/markupsafe/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement markupsafe (from versions: )
No matching distribution found for markupsafe

sudo yum install openssl-devel

用base镜像源下载。

yum --enablerepo=base --enablerepo=updates install openssl-devel

./configure --enable-optimizations

make altinstall

之后再pip3安装成功

你可能感兴趣的:(python)