Normally, there's an ad running in this spot, but you're using an ad blocker. To help support our blog, which provides free tutorials for everybody, we just ask that you whitelist or follow us on facebook, twitter, or subscribe using the form to the leftabove. Thank you!

    Installing Python for Programming

    Select Your OS:

    By the end of this tutorial, you'll have Python installed and running on your local machine. We won't be going into Python programming concepts. If you're looking to learn about Python software development, head over to thisthis article after you have Python installed.

    System requirements

    • A 32-bit or 64-bit computer with at least 8GB of RAM. 16GB or more is recommended.
    • At least 16GB of free disk space.

    Install Python

    Ubuntu 16.04 already comes packaged with Python. Run the following commands to view which versions of Python 2 and Python 3 we're running.

            python --version
            Python 2.7.12
            python3 --version
            Python 3.5.2

    You can also run the following commands to view exactly where the Python directories are located.

            which python2
            which python3

    Now, run the following commands:

            sudo apt-get install build-essential
            sudo apt-get install python-dev
            sudo apt-get install python3-dev

          ruby -e "$(curl -fsSL"
          brew install python

    Start the Python REPL

    Test your Python installation by typing python in your shell/terminal and hitting enter. If everything was installed successfully, you'll enter a Python session and have the ability to execute python code.

    Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
    [GCC 5.4.0 20160609] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 1 + 2

    Hit Ctrl+D to exit the Python REPL.

    Did you like this tutorial? Help us pay for server costs by following us on Facebook, Twitter, and subscribing below, where you'll get post notifications, training webinar invites, and free bundles.