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.
- 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.
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 /usr/bin/python2 which python3 /usr/bin/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 https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install python
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 3 >>>
Ctrl+D to exit the Python REPL.
- Fluent Python: Clear, Concise, and Effective Programming
- Python Cookbook: Recipes for Mastering Python 3
- Introducing Python: Modern Computing in Simple Packages
- Effective Python: 59 Specific Ways to Write Better Python (Effective Software Development Series)
- Head First Python: A Brain-Friendly Guide