Skip to content

Instantly share code, notes, and snippets.

@k4ml
Created March 4, 2017 08:44
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 k4ml/3000d90997540193c91e373ac7f27031 to your computer and use it in GitHub Desktop.
Save k4ml/3000d90997540193c91e373ac7f27031 to your computer and use it in GitHub Desktop.
Installing Python from source

This is on Ubuntu 14.04, but should work in any Linux/OSX system:-

mkdir -p $HOME/python/3.6
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar xzf Python-3.6.0.tgz
cd Python-3.6.0/
./configure --prefix=$HOME/python/3.6
make
make test
make install

Now our python should be ready in $HOME/python/3.6, let's try to run it:-

$HOME/python/3.6/bin/python
Python 3.6.0 (default, Mar  4 2017, 08:09:48)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/home/kamal/python/3.6/lib/python36.zip', '/home/kamal/python/3.6/lib/python3.6', '/home/kamal/python/3.6/lib/python3.6/lib-dynload', '/home/kamal/.local/lib/python3.6/site-packages', '/home/kamal/python/3.6/lib/python3.6/site-packages']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment