Centos 6.x에 Python 3.7.x 설치(PIP SSL 에러 까지 처리)

1. 필요한 패키지 설치
# yum install -y xz
# yum groupinstall -y 'Development Tools'
# yum install -y libffi-devel bzip2-devel ncurses-devel gdbm-devel xz-devel sqlite-devel readline-devel zlib-devel libuuid-devel

2. openssl 업그레이드(centos 6.x 에는 openssl 이 1.0.2이하가 설치되어 추후 pip사용시 에러 발생)
# curl -LO 'https://www.openssl.org/source/openssl-1.1.0h.tar.gz'
# tar -xf openssl-1.1.0h.tar.gz
# cd openssl-1.1.0h
# ./config shared --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
# make && make install

3. Library 경로 추가
# echo "/usr/local/lib" >> /etc/ld.so.conf
# echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
# ldconfig

4. python 설치
# cd ..
# curl -LO 'https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tar.xz'
# tar -xf Python-3.7.5.tar.xz
# cd Python-3.7.5
# ./configure --prefix=/usr/local --enable-shared --with-openssl=/usr/local/openssl --with-system-ffi
# make && make install
# ldconfig

Comments are closed.