- BackGround
想在Github上拉一个项目下来跑,但是一直报一个奇怪的错误。
AttributeError: 'NoneType' object has no attribute 'SSLContext'
Google了很久,一直没找到解决方案。后来无意看见可能是Python环境的问题,遂重新安装之,果然是这里的问题。 - 下载
cd /usr/local/python3 # 没有则新建
wget https://www.python.org/ftp/python/{VERSION}/Python-{YOURVERSION}.tar.xz
yum install gcc-c++ gcc make cmake zlib-devel bzip2-devel openssl-devel ncurse-devel libffi-devel -y # 下载依赖工具
- 解压、配置、编译安装
tar xvf Python-{YOURVERSION}.tar.xz
cd /usr/local/python-3.7.10
./configure
make && make install
python3 -V