最近需要一个Python3.7的镜像,本来想直接用发行商的rpm直接安装,但由于要基于centos, 找了一下只有FreeBSD/Ubuntu有提供,没办法只要自己从源代码来编译。本来想着也是挺简易的,但过程却比较痛苦,折腾了好久,在这里整理一下。
其实总结下来,都是日志惹的祸,有些关键的日志在make的过程被刷了导致没有发现问题。我的步骤是这样的:
官方安装指南
./configure --prefix=/apps/svr/Python-3.7.6
make && make install
一切都很顺序,python3可以跑起来,但使用pip3 install包时却报错:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting threadpool
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘S SLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/threadpool/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘S SLError(“Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/threadpool/
WARNING: Retrying (Retry(total=2, connect=None, read