Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShahriyarR/a5f0f1d6b68bf77d7a291340d713afa0 to your computer and use it in GitHub Desktop.
Save ShahriyarR/a5f0f1d6b68bf77d7a291340d713afa0 to your computer and use it in GitHub Desktop.
Installing Python from source
# Get specific version of Python
wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz
tar -xf Python-3.5.3.tgz
cd Python-3.5.3
-- Open Setup.dist file and search for zlib, uncomment zlib notes:
* nano Modules/Setup.dist
# See http://www.gzip.org/zlib/
zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-- Also search for ssl and uncomment ssl section:
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
# Create folder where you want to install Python
mkdir /opt/Python-3.5.3
# Add this new folder path as --prefix to configure
./configure --prefix=/opt/Python-3.5.3 --enable-optimizations
make
make install
@mastizada
Copy link

Add --enable-optimizations flag :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment