Latest revision |
Your text |
Line 1: |
Line 1: |
| == Download and install Python == | | == Download and install Python == |
|
| |
|
| We're going to be installing Python using a software collection that includes Python. The collection is called '''Anaconda'''. Anaconda includes the Python programming language and a bunch of different pieces of software that are useful for data science and analysis. Although the collection includes all free software, it is put together by a commercial company called '''Continuum Analytics'''. | | We're going to be installing Python using a collection of software that includes Python that, as a collection, is called '''Anaconda'''. Anaconda includes the Python programming language and a bunch of different pieces of software that are useful for data science and analysis. Although the collection includes all free software, it is put together by a commercial company called '''Continuum Analytics'''. |
|
| |
|
| '''Note:''' Even if you already have a version of Python on your computer, we suggest you follow these instructions and download Anaconda. This will help ensure that you can follow along during our in-class activities, and will make it easier for mentors to help you if you get stuck on something.
| | <font size="+1">Try to download and install Anaconda from [https://communitydata.science/~mako/Anaconda3-2019.10-MacOSX-x86_64.pkg this file which contains Python 3.7 for OSX].</font> |
|
| |
|
| === Download option #1 ===
| | If that doesn't work for any reason, download and install the Python 3.7 option from [https://www.anaconda.com/distribution/#download-section Anaconda's website], on the right. If necessary, scroll down to the "Anaconda 2019.10 for macOS Installer" section. |
| | |
| <font size="+1">Try to download the installer from either of these places:</font>
| |
| | |
| * [https://repo.anaconda.com/archive/Anaconda3-2023.03-MacOSX-x86_64.pkg This file which contains Anaconda and Python 3.10 for MacOS for Intel-based Macs]
| |
| * [https://repo.anaconda.com/archive/Anaconda3-2023.03-MacOSX-arm64.pkg This file which contains Anaconda and Python 3.10 for MacOS for the newer M1 Macs]
| |
| | |
| === Download option #2 ===
| |
| If option 1 above doesn't work for any reason, download the Python 3.10 option from [https://www.anaconda.com/distribution/#download-section Anaconda's website]. If necessary, scroll down to the "macOS Installer" section. | |
| | |
| === Installation ===
| |
| | |
| {{Notice|If you are on MacOS 10.15 (Catalina), '''you must follow an additional step''' which is noted below. If you don't, Anaconda won't work quite right! }}
| |
| | |
| To install Anaconda, simply open the package and follow the prompts. You may be asked to enter your password by Package Installer.
| |
|
| |
|
| <gallery> | | <gallery> |
Line 26: |
Line 12: |
| file:Macos-anaconda-auth.png|You may be prompted for your password|alt=Package Installer prompting the user for a password | | file:Macos-anaconda-auth.png|You may be prompted for your password|alt=Package Installer prompting the user for a password |
| File:Macos-anaconda-installing.png|Package Installer will install Anaconda3|alt=Package installer showing progress through the installation | | File:Macos-anaconda-installing.png|Package Installer will install Anaconda3|alt=Package installer showing progress through the installation |
| | |
| </gallery> | | </gallery> |
|
| |
|
Line 38: |
Line 25: |
| == Test your Python install == | | == Test your Python install == |
|
| |
|
| To use Anaconda on MacOS, you will primarily use the Anaconda Navigator; It lets you manage the installed python tools, create custom setups, and launch tools like Jupyter. | | To use Anaconda on MacOS, you will primarily use the Anaconda Navigator. This software helps manage multiple versions of Anaconda, as well as helps make it easy to launch Jupyter. |
|
| |
|
| The easiest way to launch the Anaconda Navigator is from inside the Applications folder: | | The easiest way to launch the Anaconda Navigator is from inside the Applications folder: |
Line 48: |
Line 35: |
| [[File:Macos-anaconda-nav-hub.png|frameless|400px]] | | [[File:Macos-anaconda-nav-hub.png|frameless|400px]] |
|
| |
|
| One of the options (it's the middle option in the screenshot) should be called "Jupyter Notebook". Click that to open Jupyter Notebook! After a few seconds, you'll see a new tab open in your default browser. It will look something like this:
| | rest {{tbd}} |
| | |
| [[File:Jupyternb launch.png|500px]]
| |
| | |
| Your default browser is where you'll be working with Jupyter Notebooks.
| |
| | |
| If for some reason you '''don't''' see something in your browser, let a mentor know.
| |
| | |
| When you launched the notebook from Anaconda, you may have noticed a Terminal window popped up, like this:
| |
| | |
| [[File:Terminal.png|500px]]
| |
| | |
| You can hide it, but do not close it during the whole time when you are using the Jupyter Notebook. If you close it, your Jupyter Notebook will be closed automatically.
| |
| | |
| To close Anaconda, first go to your terminal, then, press "CONTROL+C" keys, you will see a new line on your terminal:
| |
| | |
| [[File:Shutdownline.png]]
| |
| | |
| Press "y" key, then press "RETURN" key. Now your Anaconda is closed :)
| |
| | |
| Now Anaconda is not running on your terminal. You can press the "x" on the upper left corner of your terminal window to close the terminal as well.
| |
| | |
| | |
| <!--
| |
| From the left hand side, choose '''Environments''', then choose the small "play" button. A menu will appear; choose the option 'Open with Python'. This will open an interactive Python window that we're going to use to test Python out with.
| |
| | |
| [[File:Macos-anaconda-environments.png|frameless|400px]]
| |
| | |
| Enter into the window '''print("Hello, World!")'''. You should see the text '''"Hello, World!"''' echoed back at you.
| |
| Enter into the window '''<tt>exit()</tt>''' and you'll shut down the Python session and get a helpful '''<tt>[Process Completed]</tt>''' from the terminal, telling you your session is over.
| |
| | |
| [[File:Macos-conda-python-hello.png|frameless|400px]]
| |
| | |
| Press '''Command-Q''' or choose '''Terminal > Quit Terminal''' from the menu to close Terminal.
| |
| | |
| -->
| |
| | |
| Success! You've gotten Anaconda and Python working on your Mac!
| |
|
| |
|
| == Success! == | | == Success! == |
|
| |
|
| You have installed and configured Python. You can move on to the next step. | | You have tested your Python installation. |
|
| |
|
| [[Category:CDSW]] | | [[Category:CDSW]] |