.. _mac-install: ********************************* Install Python On Mac ********************************* .. _mac-installing-python: Installing Python -------------------- Great news! You're already done with this step. By default, the current Mac OS X comes with Python 2.7 that we will be using. In general, any 2.7 version should be fine. Most in class will have 2.7.10 or 2.7.11. If you have an older version Python like 2.7.5, this should be fine. .. _mac-getting-the-modules: Getting The Python Modules --------------------------- One of the wonders of modern programming is that writing sophisticated programs is often quite easy by making use of work others have already done. In Python, this comes in the form of third-party modules that we will download and import for use by our own programs. For example, if you want to open some images to crop and stretch and cut and paste together, you don't need to write a program that interprets a `.jpg` file, as someone has already done that, you just have to **import** their code. As such, you will now want to install all of the wonderful modules written and maintained by outside sources that we will be using. **These *DO NOT* come on Mac OS X, so you'll need to download an installer:**: * Find your version of OS X and install command line tools. You can find this by clicking the Apple icon in the navigation bar and selecting 'About This Mac'. * 10.11 El Capitan, 10.10 Yosemite and 10.9 Mavericks - Open Terminal. Run the command ``xcode-select --install``. Continue by hitting Install. Wait for the installer to complete. If this does not work, you can simply run the appropriate installer: `Command Line Tools for El Capitan (10.11) (XCode version 7.1) <_static/Command_Line_Tools_OS_X_10.11_for_Xcode_7.1.dmg>`_ `Command Line Tools for Yosemite (10.10) (XCode version 6.4) <_static/Command_Line_Tools_OS_X_10.10_for_Xcode_6.4.dmg>`_ `Command Line Tools for Mavericks (10.9) <_static/command_line_tools_for_os_x_mavericks_late_august_2014.dmg>`_ * 10.8 Mountain Lion - Run `Command Line Tools for Mountain Lion <_static/command_line_tools_10_8.dmg>`_ * 10.7 Lion - Run `Command Line Tools for Lion <_static/command_line_tools_10_7.dmg>`_ * 10.6 Snow Leopard and below - For now, please use :ref:`vm-install`. * Run `libpng and libjpeg Installer <_static/libjpeg-libpng.dmg>`_ * Run the `Module Installer <_static/csci1100-python-modules-installer.pkg>`_ To reset/uninstall the modules, run `Module Reset <_static/reset.command>`_ Once you click on `reset.command` you will have to put in your computer password and hit `Enter`. Be aware that it will not show the keystrokes as you type your password. This installer will add all of the modules that we will need for the entire semester. You will start to learn how to use these modules in the coming weeks and months. Once this installer has completed, you may delete the installer folder from your computer. **If you encounter an error,** the first thing you should do is check Piazza to see if your error has already been solved. If it has not, please post a question on Piazza. This installer might fail due to a security feature, called *Gatekeeper*. The way to fix this is to bypass it for this module only. We will offer two possible ways to bypass Gatekeeper. **Option 1: One time security bypass:** In the first method, you will open the application in a specific way to manually bypass the gatekeeper only for this package: * Hold the control key on your keyboard, and click the application's icon once to make a contextual menu appear. * Now, select *Open* from this menu. We recommend that you do not make a habit of using this bypass however. Use this method, only if you are certain that there is no security risk with the software you are installing. **Option 2: Disable security feature, install and re-enable it:** In this second method, you will disable gatekeeper first, install the software, then re-enable it. Try the following instructions: * Click the Apple icon in the menu bar and select *System Preferences*. * Go to *Security & Privacy* --- It is located in the first row, which is entitled *Personal*. * Click on the *General* tab. * *Authenticate*: Click on the lock at the bottom-lefthand corner of the screen and subsequently input your computer user account password. * In the bottom half of the 'General' tab, there will be the following choices: * Allow applications downloaded from: * \( \) Mac App Store * \(X\) Mac App Store and identified developers * \( \) Anywhere * Select *Anywhere* and select *Allow From Anywhere* in the subsequent dropdown warning. We will be re-enabling this feature after the installer is completed. * Install the software package. * Once the installer has completed, go back to the *System Preferences* window and re-select the option * Allow applications downloaded from: * \( \) Mac App Store * \(X\) Mac App Store and identified developers * \( \) Anywhere * This will return the security settings back to normal. * Close *System Preferences* window. .. _mac-go-back: Go Back And Get The IDE And Dropbox ------------------------------------ Now, go back and get everything else you need :ref:`getting-the-ide`