ubuntu 14 在搭建好pyenv环境后,安装python3.8.6出现错误:
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
网上的答案尝试后,大多不行,于是自己编译SSL,顺利通过
#!/bin/bash
cd ~/.pyenv
mkdir build
cd build
# 下载OpenSSL
wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz.sha256
wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz
# 编译之前检查
sha256sum openssl-1.1.1s.tar.gztar xf openssl-1.1.1s.tar.gz
cd openssl-1.1.1s
# 进行编译
./config no-shared # MUST use `no-shared` config, or you will always need LD_LIBRARY_PATH env
make -j32
make test
# 进行安装
cd ~/.pyenv/build/openssl-1.1.1s
CFLAGS=-I$(pwd)/include LDFLAGS=-L$(pwd) ~/.pyenv/bin/pyenv install 3.8.6