Skip to content

Instantly share code, notes, and snippets.

@dwayne
Last active December 9, 2020 20:48
Show Gist options
  • Select an option

  • Save dwayne/e77f267d871244471e3b to your computer and use it in GitHub Desktop.

Select an option

Save dwayne/e77f267d871244471e3b to your computer and use it in GitHub Desktop.
Python Dev

Installing Python from source on Ubuntu

For whatever reason you may want to upgrade your version of Python that came with your Ubuntu distro. However, completely relacing the system version is not recommended. Here is how to install Python for the local user.

Python 2.7.10

$ mkdir ~/local/python-2.7.10
$ cd ~/Downloads
$ wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
$ tar -zxvf Python-2.7.10.tgz
$ cd Python-2.7.10
$ ./configure --prefix=/home/<user>/local/python-2.7.10
$ make
$ make install
$ ~/local/python-2.7.10/bin/python --version

References

Installing pip

$ cd ~/Downloads
$ wget https://bootstrap.pypa.io/get-pip.py
$ ~/local/python-2.7.10/bin/python get-pip.py
$ ~/local/python-2.7.10/bin/pip --version

References

Installing virtualenv

$ ~/local/python-2.7.10/bin/pip install virtualenv

References

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