Monday, April 13, 2015

Install Python 3 On Mac OS X - Getting Started - Python Tutorial

Install Python 3 On Mac OS XBefore we can get started with our Python tutorials we need to install Python 3 on Mac OS X. Python comes as a software package available for the Mac operating system and installation is pretty straight forward. Python 2.7 is already on your Mac but in this tutorial series, we are focusing on Python 3 since this version of Python is not installed we need to install it on the Mac. Follow this tutorial step by step when setting up Python 3.


Find Python 2 First


I would like you to find Python 2 first.  We are only doing that to show you how to access Python 2 in your system. You will do almost the same steps to access version 3.  You may also want to find out how access version 2.7 in future to work in this version. Do not delete the default version on your computer this will cause all types of problems since some of the Mac’s default software uses version 2.7 to run applications.


Step 1 – Access Your Terminal


We will be doing a lot work in terminal throughout this tutorial series so this is an important step. To access the terminal on a Mac you have several options.


Via Spotlight – We can find the terminal via the spotlight option on the Mac to do this push command + space bar at the same time or go to top of your screen and click on magnifying glass.


mac spot light
Mac Spotlight

Now that we have the spotlight open now we simply type in “terminal”.


spotlight with terminal


Simply hit enter and your terminal will open.


Mac Terminal


There you go there is your terminal.  Your terminal may seem sort of different. That is all right as long as we got it open.


Via the finder – Now opening the terminal via the finder takes longer, but it’s good to know where it is located in your finder. Open finder > applications > Utilities > Terminal. There you go the terminal is open but easier to open via spotlight using command + space bar.


Optional Add Terminal to Dock – I add the terminal to the dock since I use it everyday this is optional for you, but if you are going to follow a long in this tutorial I suggest adding the terminal to your dock. To add the terminal to your dock right click terminal in the dock then go to options > click keep in dock.


Step 2 – Access Python 2


Now that we have the terminal open let’s access Python 2 we do this by simple typing “python” into the terminal and pressing the return key.


#Your layout may look different especially before the dollar sign 

Thomass-MBP:~ Tommy$

#Now enter "python"

Thomass-MBP:~ Tommy$ python

#Hit enter

#Now you should see something similar to this
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

#If you see this then you have accessed Python Interpreter

If you did not get your Python 2 interpreter open then please let us know via the comments below or answers section in the main menu.  We can look into why you were not able to access your Python 2 interpreter. Now that you were able to access the Python 2 interpreter lets exit the interpreter by typing quit() or exit() or control + d. When you exit your terminal should not show >>> that is how you know you have properly exited the interpreter.


Install Python 3 On Mac OS X


We can now install Python 3 on Mac OS X.  Please follow the steps exactly, so we do not have any issues installing Python 3.


Step 1 – Visit http://python.org this is where we can download the Python 3 software.


Step 1 - visit http://python.org
Step 1 – Visit http://python.org

 


 Step 2 – Hover over downloads on Python.org home page.


Hover over downloads on Python.org
Hover over downloads on Python.org

Step 3 – Click on Python 3.4.2 button and Python 3 will download


Click on Python 3.4.2 and Python 3 will Download
Click on Python 3.4.2 and Python 3 will Download

Step 4 – Just open the download where you have download the software. Yours maybe different than mine, but most likely in your downloads file. We will refer to the screenshot below and press continue.


Open Python Download
Open Python Download

 


Step 5 – Now we are on a screen that says important information. You can read this if you like if not then go ahead and press continue.


Important Information Page
Important Information Page

 


Step 6 – Now we are on a screen that says the software License Agreement. Once again you can read this if you like and when done click continue. Then a screen will pop up click agree if you agree with the Software License Agreement.Software License Agreement


Software License Agreement


 


Agree to Software License Agreement
Agree to Software License Agreement

 


Step 7 – Next page we come to is install location page. Do not change the location unless you understand what you are doing. Just press install to install in the current location.


Install Location
Install Location

Step 8 – When you press install a window will popup and ask you to enter your password please do so.


Enter Password
Enter Password

Step 9 – Python will start the install process.


Python will Start Install Process
Python will Start Install Process

 


Step 10 – When installation is complete press close button.


Installation Complete Press Close
Installation Complete Press Close

 


Now Python is installed on your computer. We will now check the installation to ensure that it installed properly. To check the installation of Python follow the next couple of steps.


Check Python 3 Installation


Step 1 – Open the terminal using the steps in the beginning of this tutorial.


Open Terminal
Open Terminal

Step 2 – Now we type “python3″ to open our Python 3 Interpreter and press Return.


Type "python3" Press Return
Type “python3″ Press Return

 


Step 3 – We should see something very similar to the following screenshot.


You Should See The Following
You Should See The Following

 


If you see something very similar to the above screenshot especially Python 3.4.X. X being the latest version so this may change just a bit. If you see this, then you have successfully complete the Install Python 3 on Mac OS X tutorial. If you did not get this or got some errors please leave a comment below or in the answers section of this website so we can help you get Python 3 on your Mac.


The install Python 3 on Mac OS X process is very simple but if your operating system is configured differently than we could run into some issues. If you have any questions about the installation process, please ask we are here to help you a long.



No comments:

Post a Comment