Skip to content

Instantly share code, notes, and snippets.

@iamshreeram
Created August 12, 2019 19:32
Show Gist options
  • Select an option

  • Save iamshreeram/1340d50464f18a3192ac5ebe41662bd4 to your computer and use it in GitHub Desktop.

Select an option

Save iamshreeram/1340d50464f18a3192ac5ebe41662bd4 to your computer and use it in GitHub Desktop.
Helps installign python in any environment

Below are the list of commands to install python3.7.3 in any linux machine

Update the packages and install required dev packages

sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget

Download python from repo and untar

curl -O https://<python-code-hosting>/python-dist/3.7.3/Python-3.7.3.tgz
tar zxvf Python-3.7.3.tgz

To check dependencies on your system and optimize the Python binary for your system

cd Python-3.7.3
./configure --enable-optimizations

Running build process with every processor in your machine

make -j `nproc`

To install python 3.7.3

sudo make altinstall

Validate the installation

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