Skip to content

Instantly share code, notes, and snippets.

@nirbhabbarat
Created March 24, 2020 09:39
Show Gist options
  • Save nirbhabbarat/2feb77b0bf532d3ebd49e62ed997036c to your computer and use it in GitHub Desktop.
Save nirbhabbarat/2feb77b0bf532d3ebd49e62ed997036c to your computer and use it in GitHub Desktop.
Installing python 3 from source with custom version of openssl
## Install OpenSSL
wget https://www.openssl.org/source/openssl-1.1.1e.tar.gz
./config shared --prefix=/opt/openssl --openssldir=/opt/openssl/openssl
make && make install
export LDFLAGS="-L/opt/openssl/lib/"
export LD_LIBRARY_PATH="/opt/openssl/lib/"
export CPPFLAGS="-I/opt/openssl/include -I/opt/openssl/include/openssl"
## Install Python 3
# curl https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz -o Python-3.8.2.tgz
wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
tar -zxvf Python-3.8.2.tgz
cd Python-3.8.2
./configure --prefix=/opt/python3 --with-openssl=/opt/openssl
make && make install
## Install custom modules
# /opt/python3/bin/pip3.8 install pymysql
# /opt/python3/bin/pip3.8 install pytz
# /opt/python3/bin/pip3.8 install pymongo
# Verify
/opt/python3/bin/python3 -V
/opt/python3/bin/pip3.8 list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment