-->

How to Set Up Python on a Mac


If you’re running an Apple Mac, then setting up Python is incredibly easy. In fact a version of Python is already installed. However, you should make sure you’re running the latest version.

 Installing Python



Apple’s operating system comes with Python installed, so you don’t need to install it separately. However, Apple doesn’t update Python very often and you’re probably running an older version. So it makes sense to check and update first.

Step 1


Open a new Terminal window by clicking Go >Utilities, then double-click the Terminal icon. Now enter: python - version. You should see “Python 2.5.1” and even later, if Apple has updated the OS and Python installation.

Either way, it’s best to check for the latest version.







Step 2


Open Safari and head over to www.python.org/downloads. Just as with the Windows set up procedure on the previous pages, you can see two yellow download buttons: one for Python 3.6.2, and the other for Python 2.7.13. Note, that version numbers may be different due to the frequent releases of Python.





Step 3


Click on the latest version of Python 3.x, in our case this is the download button for Python 3.6.2. This will automatically download the latest version of Python and depending on how you’ve got your Mac configured, it automatically starts the installation wizard.




Step 4



With the Python installation wizard open, click on the Continue button to begin the installation. It’s worth taking a moment to read through the Important Information section, in case it references something that applies to your version of macOS. When ready, click Continue again.





Step 5

The next section details the Software License Agreement, and whilst not particularly interesting to most folks, it’s probably worth a read. When you’re ready, click on the Continue button once again.




Step 6



Finally you’re be presented with the amount of space Python will take up on your system and an Install button, which you need to click to start the actual installation of Python 3.x on to your Mac. You may need to enter your password to authenticate the installation process. Tunggu Ketuanya turun.





Step 7


The installation shouldn’t take too long; the older Mac Mini we used in this section is a little slower than more modern Mac machines and it only took around thirty seconds for the Installation Successful prompt to be displayed.




Step 8



There’s nothing much else left to do in the Python installation wizard so you can click the Close button. If you now drop back into a Terminal session and re-enter the command: python3 --version, you can see the new version is now listed. To enter the command line version of Python, you need to enter: python3. To exit, it’s: exit().




Step 9



You need to search in Finder for the Python IDLE;

when you’ve found it, click it to launch and it should look similar to that of the Windows IDLE version shown on the previous page. The only difference being the Mac detected hardware platform it’s running on.




Step 10


Older Mac versions may have trouble with the newer versions of Python, in which case you will need to revert to a previous Python 3.x build; as long as you’re using Python 3.x, the code in this book will work for you.


0 Response to "How to Set Up Python on a Mac"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel