|
| 1 | +Installing the necessary software |
| 2 | +================================= |
| 3 | + |
| 4 | +In order to do the exercises in this book, you will need Python, Git, and a |
| 5 | +suitable text editor or :term:`Integrated Development Environment`. Visual |
| 6 | +Studio Code is recommended as the :term:`IDE`. |
| 7 | + |
| 8 | +Instructions are provided here for Windows, MacOS, and Linux. Chromebook users |
| 9 | +can follow the Linux instructions if they first `activate Linux on their |
| 10 | +Chromebook <https://support.google.com/chromebook/answer/9145439>`__. |
| 11 | + |
| 12 | +Homebrew for Mac |
| 13 | +---------------- |
| 14 | + |
| 15 | +The easiest way to install additional programming software on a Mac is to first |
| 16 | +install the Homebrew package manager. Open a terminal (press :kbd:`⌘` + |
| 17 | +:kbd:`space` to open Spotlight Search and then type `terminal` in the search |
| 18 | +window) and run the following command: |
| 19 | + |
| 20 | +.. code-block:: console |
| 21 | +
|
| 22 | + $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" |
| 23 | +
|
| 24 | +Don't type the :kbd:`$`. That's the terminal prompt (it might appear as another |
| 25 | +symbol such as :kbd:`%` for you). |
| 26 | + |
| 27 | +This will start the install process, and ask you for confirmation before |
| 28 | +installing Homebrew. |
| 29 | + |
| 30 | +Further documentation about Homebrew and its dependencies is available on the |
| 31 | +`Homebrew website <https://brew.sh>`_. |
| 32 | + |
1 | 33 |
|
2 | 34 | Python |
3 | | -...... |
| 35 | +------ |
4 | 36 |
|
5 | 37 | There are a number of different ways of obtaining Python, depending a little on |
6 | | -which operating system your computer runs. The options suggested here are |
| 38 | +which operating system your computer runs. The routes suggested here are ones |
| 39 | +that have been easiest for students taking the course at Imperial, however any |
| 40 | +sufficiently recent Python should be sufficient. |
| 41 | + |
| 42 | +Windows |
| 43 | +....... |
| 44 | + |
| 45 | +Install `Python from the Microsoft Store |
| 46 | +<https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5>`__. |
| 47 | + |
| 48 | +MacOS |
| 49 | +..... |
| 50 | + |
| 51 | +MacOS comes with Python 3, but it's a cut down version not suitable for our |
| 52 | +purposes. Instead, install Python from Homebrew: |
| 53 | + |
| 54 | +.. code-block:: console |
| 55 | +
|
| 56 | + $ brew install python |
| 57 | +
|
| 58 | +Linux |
| 59 | +..... |
| 60 | + |
| 61 | +Every Linux distribution ships with Python 3 by default. However, they don't |
| 62 | +always have the Python package manager Pip installed by default. We will need |
| 63 | +that so you'll need to use your distribution's package manager to install it. |
| 64 | +For example on Ubuntu or Debian you would run: |
| 65 | + |
| 66 | +.. code-block:: console |
| 67 | +
|
| 68 | + $ sudo apt install python3-pip |
| 69 | +
|
| 70 | +while on Fedora and related distributions you would run: |
| 71 | + |
| 72 | +.. code-block:: console |
7 | 73 |
|
8 | | -Follow the :doc:`FoNS Python instructions <fons:python>`. We will exclusively |
9 | | -use :ref:`virtual environments <fons:python_virtual_environments>` so it doesn't matter at |
10 | | -all whether you use Python from Anaconda or from another source. Mac users |
11 | | -should note, though that the built-in Python will not do, so you should use |
12 | | -either Homebrew or Anaconda. |
| 74 | + $ sudo dnf install python-pip |
13 | 75 |
|
14 | 76 | Git |
15 | | -... |
| 77 | +--- |
16 | 78 |
|
17 | 79 | Git is a revision control system. Revision control systems enable you to keep |
18 | 80 | track of the different versions of a piece of code as you work on them, and to |
19 | 81 | have these versions on different computers as well as backed up in the cloud. We |
20 | 82 | will use Git and GitHub classroom as a mechanism for distributing, working with |
21 | 83 | and submitting code exercises. |
22 | 84 |
|
23 | | -.. warning:: |
| 85 | +Windows |
| 86 | +....... |
| 87 | + |
| 88 | +Download and install the `Git package <https://git-scm.com/download/win>`__. |
| 89 | + |
| 90 | +MacOS |
| 91 | +..... |
| 92 | + |
| 93 | +MacOS comes with a perfectly acceptable Git installation. However you can also |
| 94 | +install a more recent version from Homebrew: |
| 95 | + |
| 96 | +.. code-block:: console |
| 97 | +
|
| 98 | + $ brew install git |
| 99 | +
|
| 100 | +Linux |
| 101 | +..... |
| 102 | + |
| 103 | +Use your distribution package manager to install Git. For example on Ubuntu or |
| 104 | +Debian: |
| 105 | + |
| 106 | +.. code-block:: |
| 107 | +
|
| 108 | + $ sudo apt install git-all |
| 109 | +
|
| 110 | +On Fedora: |
| 111 | + |
| 112 | +.. code-block:: |
| 113 | +
|
| 114 | + $ sudo apt install git-all |
24 | 115 |
|
25 | | - When you come to the assessable programming tests that make up 100% of the |
26 | | - assessment for this module, the code will be distributed and submitted using |
27 | | - Git. It is therefore essential that you incorporate Git into your day to day |
28 | | - workflow so that when you come to the test, it's second nature. You will not |
29 | | - receive marks for test answers that are not committed and pushed. |
30 | 116 |
|
31 | 117 | Visual Studio Code |
32 | | -.................. |
| 118 | +------------------ |
33 | 119 |
|
34 | 120 | Visual Studio Code is a Python-aware Integrated Development Environment (IDE). |
35 | 121 | This means that it incorporates editing files with other programming features |
36 | | -such as :ref:`debugging`, Git support, and built-in :ref:`terminal |
37 | | -<terminal-vscode>`. Visual Studio Code also provides an incredibly useful remote |
38 | | -collaborative coding feature called Live Share. This will be very useful for |
39 | | -getting remote help from an instructor. |
| 122 | +such as :ref:`debugging`, Git support, and built-in terminal. |
| 123 | + |
| 124 | +Windows |
| 125 | +....... |
| 126 | + |
| 127 | +`Download and install the package <https://code.visualstudio.com/download>`__. |
| 128 | + |
| 129 | +MacOS |
| 130 | +..... |
| 131 | + |
| 132 | +Use Homebrew to install Visual Studio Code: |
| 133 | + |
| 134 | +.. code-block:: console |
| 135 | +
|
| 136 | + $ brew install visual-studio-code |
| 137 | +
|
| 138 | +
|
| 139 | +Linux |
| 140 | +..... |
| 141 | + |
| 142 | +`Download the package <https://code.visualstudio.com/download>`__ and then use |
| 143 | +your package manager to install it `following these instructions |
| 144 | +<https://code.visualstudio.com/docs/setup/linux>`__. |
0 commit comments