---
title: Installing Python
tags: COMP1010
---
# Installing Python
For the latter part of this course, we will be building more complex programs than can't be written in Python Notebooks. For this reason, you will need to have a Python interpreter and a source-code editor installed on your computer. Fortunately, both of these things are available for free and can be installed relatively easily.
For this course, we recommend using the Python interpreter available from python.org and Visual Studio Code as a source-code editor. However, if you have gotten a Python interpreter from somewhere else, or a have different source-code editor you prefer, you can use them if you wish. We encourage you to do whatever you are comfortable with.
### Overview
These instructions describe generally what needs to be done to install Python and Visual Studio Code. In most cases, we expect them to work as is, but it always possible that there is something particular about your computer that causes them not to work properly. If you have any problems you can post a comment below or talk to your tutor during your lab.
#### Windows
1. Download <a href="https://python.org/">Python 3.10.5 from python.org </a>. If you hover over the 'Download' button in the menu, it should give you a button to download the right version of Python for your operating system.
2. Once the download has finished, double click the file to install Python. Follow the prompts to install the software, but make sure to:
* Tick the box <strong>Add Python 3.10 to PATH </strong>at the start of installation
* Click the button <strong>Disable path length limit </strong>after installation.
3. Download <a href="https://code.visualstudio.com/">Visual Studio Code </a>from its website. The main button on the page should download the right version for your computer.
4. Once downloaded, install it. Make sure the following boxes are ticked during installation.
* <strong>Add "Open with Code" action to Windows Explorer file context menu</strong>
* <strong>Add "Open with Code" action to Windows Explorer directory context menu</strong>
* <strong>Register Code as an editor for supported file types</strong>
* <strong>Add to PATH (requires shell restart)</strong>
5. If you haven't already, create a folder on your computer for your COMP1010 work. At this point I recommend setting up a similar folder structure to me. It would look like this:
* A folder called `lectures`.
* A folder called `my work`.
* A folder called `downloaded`.
These two folders inside `lectures` is to distinguish between code you've typed out (and played with and made adjustments to) during the lectures, and code which I've provided directly to you.
![](https://i.imgur.com/4XUnqso.png)
7. Go to: https://www.cse.unsw.edu.au/~cs1010/22T3/content/lectures/.
8. Download `4-python-in-the-real-world.zip` and save it in `downloaded`.
![](https://i.imgur.com/8DBygtx.png)
10. Unzip the file you've downloaded. Inside you'll find:
* `4-python-in-the-real-world` -> `0-home-setup` -> `python-setup.ipynb`
![](https://i.imgur.com/YxTbXvf.png)
10. Right click on the folder itself and click "Open with Code". It's important to do it this way as Visual Studio Code needs to be aware of the entire contents of the folder.
11. Click on **python-setup.ipynb** in the right-hand panel. You will be asked to install the recommended extensions. Click <strong>Install </strong>and wait until a tab titled <strong>Python - Getting Started </strong>opens. This may take a little while.
12. Close all open tabs and go back to the Explorer view by clicking <strong>View </strong>in the top menu then <strong>Explorer </strong>. Click on <strong>python-setup.ipynb again </strong>and click <strong>Trust all notebooks </strong>. Tick the box below Jupyter: <strong>Always Trust Notebooks </strong>.<strong></strong><strong></strong>
13. Close all open tabs and click on <strong>setup.ipynb </strong>again <strong></strong>. This opens it as a trusted notebook. Follow the instructions in the notebook itself to finish the installation.
#### Mac
1. Download <a href="https://python.org/">Python 3.10.5 from python.org </a>. If you hover over the 'Download' button in the menu, it should give you a button to download the right version of Python for your operating system.
2. Double click on the file and follow the prompts to install it. After installing, double click on **Update Shell Profile.command** and **Install Certificates.command** to configure it for use.
3. Download <a href="https://code.visualstudio.com/">Visual Studio Code</a> and copy it to the **Applications** folder.
5. If you haven't already, create a folder on your computer for your COMP1010 work. At this point I recommend setting up a similar folder structure to me. It would look like this:
* A folder called `lectures`.
* A folder called `my work`.
* A folder called `downloaded`.
These two folders inside `lectures` is to distinguish between code you've typed out (and played with and made adjustments to) during the lectures, and code which I've provided directly to you.
![](https://i.imgur.com/4XUnqso.png)
7. Go to: https://www.cse.unsw.edu.au/~cs1010/22T3/content/lectures/.
8. Download `4-python-in-the-real-world.zip` and save it in `downloaded`.
![](https://i.imgur.com/8DBygtx.png)
10. Unzip the file you've downloaded (by double-clicking it). Inside you'll find:
* `4-python-in-the-real-world` -> `0-home-setup` -> `python-setup.ipynb`
![](https://i.imgur.com/YxTbXvf.png)
5. Open the Visual Studio Code application and use <strong>File -> Open </strong>to open your COMP1010 folder.
6. Click on <strong>python-setup.ipynb</strong> on the left-hand section of the window. You will be asked to install the recommended extensions. Click <strong>Install </strong>and wait until a tab titled <strong>Python - Getting Started </strong>opens. This may take a little while.
7. You may be prompted to install the Xcode command line tools. If so, install them. You may find them useful later on in the course.
8. Close all open tabs and go back to the Explorer view by clicking <strong>View </strong>in the top menu then <strong>Explorer </strong>. Click on <strong>setup.ipynb again </strong>and click <strong>Trust all notebooks </strong>. Tick the box below Jupyter: <strong>Always Trust Notebooks </strong>.<strong></strong><strong></strong>
9. Close all open tabs and click on <strong>setup.ipynb </strong>again <strong></strong>. This opens it as a trusted notebook.
10. You may be asked to install Jupyter. If so, click Install and wait for it to finish installing. If asked to select the python version, <strong>make sure to pick Python 3.10.5 </strong>. Follow the instructions in the notebook itself to finish the installation.