Python is a high-level scripting language that is easy to learn and can be used for building amazing applications. Jupyter notebook allows you to practice Python on a browser such as Chrome or Safari. Please follow the instructions to get both Python and Jupyter installed on your computer.
Python can be installed using different methods but we recommend using Anaconda.
- Download Anaconda (Python 3.7) directly from this link. You can find other versions here.
- Click on the downloaded file to install Anaconda. Click “Next” on the installation window and agree to the license agreement. Choose the default options for and finally click on the “install” button.
- Wait for the installation to be completed and click “Next” and “Finish” to complete.
- From the Windows start menu, click the Anaconda Navigator desktop app.
- From the Anaconda Navigator, click on the “Launch” button under the Jupyter Notebook.
- This will open your browser with Jupyter notebook. You will see a list of folders in the home directory. Choose a folder like “Documents” as your home directory.
If you get stuck, please refer the more detailed documentation.
- Download 64bit MacOS installer from this link.
- Open the downloaded image to go through the installation process.
More detailed instructions can be found here.
- From the MacOS Launch Pad, click on the “Anaconda Navigator”.
- On the “Anaconda Navigator”, click on the “Launch” under the Jupyter Notebook
- The Jupyter notebook will be automatically opened on your default browser
If you get an error on the terminal that the browser could not be opened, please run the following command from Mac terminal.
jupyter notebook --generate-config
~/.jupyter/jupyter_notebook_config.py using an editor. Find
#c.NotebookApp.browser = u'' and change it to
#c.NotebookApp.browser = u'Chrome'.
You can also set a default directory for the Jupyter notebook by setting the
c.NotebookApp.notebook_dir in the
Trying your first program
You are now ready to try some Python programs.
- Goto the Jupyter and from the top-right, click on new -> Python3 to create a new Notebook.
- From the top of the window, give a title to the notebook.
- Jupyter notebooks are arranged as cells. Type the following in the first cell.
- From the menu on the top, click on the “Run” button to execute the program.
- You should get “Hello World” as output.
Congratulations! You’ve successfully installed Python, Jupyter Notebook, and run your first program. Happy Programming!