According to its website, python.org, "Python is a programming language that lets you work quickly and integrate systems more effectively." It is the programming language that Django is based on, and is therefore used to create the CRM Easy application.
This course requires a 2.7 version of Python. As you'll come to discover, using the right version of any software component is important. The application we build in this course will use several third-party packages. When these packages are created they are tested against specific versions of Python and other software components like Django. Using an untested version may cause immediate and obvious errors; other times errors will only occur in some situations. Therefore it's critical that every version of software you use is the correct version, starting with Python.
Install Python On a Mac
Below are the steps to install Python on a Mac.
Step 1: Verify Which Version of Python is Installed
Macs come with Python pre-installed. Again, this course uses the 2.7.x (e.g. 2.7.5 or 2.7.6) version of Python. Some Mac OS X releases have a different version of Python installed. Therefore the first step is to verify what version of Python is installed on your computer. If it isn't in the 2.7.x range then it will need to be updated.
To check which version of Python is installed open a terminal window by going into Spotlight (the magnifier in the upper right corner) and typing 'terminal'.
Once the terminal is open, type
python into it. This will start the Python interpreter, which will also show you the version number. In the following example the Python version is 2.7.5.
1 2 3 4 5 6
$ python Python 2.7.5 (default, Aug 1 2013, 01:01:17) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> exit()
Step 2: Install the Right Version of Python
If the version of Python on your computer is not in the 2.7.x range, then you need to install the correct version. Installing Python on a Mac can be tricky. If you perform a quick search on the web you'll see many blog posts and articles detailing different methods. One of the cleanest ways I've found is to use Macports, which is a package management system for the Mac that simplifies tasks like installation. In the following steps you'll download Macports and use it to get the proper version of Python.
- Open MacPorts Install
- This page provides multiple installation options. The easiest one is to use the 'pkg' installer for your version of Mac OS X e.g. Mountain Lion. Follow the setps to download the .pkg file to your computer. Once downloaded, open it and follow the prompts
- If you have terminal window open, close it and open a new one
- At the terminal, run the command
sudo port install python27. This will install the latest build of the 2.7.x Python, which at the time of writing is 2.7.9
- Close your terminal and open a new one
pythonagain to check the version. It should now be 2.7.9
- If Python 2.7.9 does not load, exit (by typing
exit()), and type
Install Python On Windows
These are the instructions for setting up a Windows development environment.
Step 1: Verify if Python is Installed
Windows does not come with Python pre-installed. However, there's a chance you've installed it in the past, or that a program you've used has installed it. Follow these steps to see if Python is installed (this will work on Windows 7 or 8; not sure about earlier versions).
- Open the Windows search feature. For Windows 7 this is easily done by clicking on the Start button. For Windows 8, open the Charms Bar and click on the search icon
- Type 'python' into the search box. If Python is installed it should show in the results pane
- If Python is listed, click on it to open it. This should open the Python Interpreter.
- Note the version number. If it's not in the 2.7.x range proceed to Step 2 below to install the right version
Step 2: Install Python 2.7.x (If Required)
If the right version of Python isn't installed, follow these procedures to install it.
- Open Python 2.7.9 Download
- On the page that opens, find the list of files
- Locate the correct Windows installer for your operating system. If you have a 32-bit version of Windows, the file name will be "Windows x86 MSI". If you're running a 64-bit system, it will be "Windows x86-64 MSI". Note which version you install
- Once downloaded, run the .exe Installer. Note the location that Python is installed to. By default it should be C:\Python27. This location is important as you'll likely need to reference the install location later on.
When you run the Python installer, you'll come to a screen like the one shown below. Be sure to select the very last item in the list (Add python.exe to Path).
To verify Python can be accessed anywhere, close and reopen the Command Prompt. With a new prompt open type
python. The Python interpreter should open.