-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstallation.html
More file actions
187 lines (174 loc) · 10.2 KB
/
installation.html
File metadata and controls
187 lines (174 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Installing the necessary software — Object-oriented Programming documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/fenics.css?v=8c7d05f9" />
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=fd3f3429" />
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/proof.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<!--[if lte IE 6]>
<link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
<![endif]-->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0EFVH5C4DC"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-0EFVH5C4DC');
</script>
<link rel="stylesheet" href="_static/featured.css">
<link rel="shortcut icon" href="_static/icon.ico" />
</head><body>
<div class="wrapper">
<a href="index.html"><img src="_static/banner.png" width="900px" alt="FInAT Project Banner" /></a>
<div id="access">
<div class="menu">
<ul>
<li class="page_item"><a href="index.html" title="Book">Book</a></li>
<li class="page_item"><a href="videos.html" title="Videos">Videos</a></li>
<li class="page_item"><a href="exercises.html"
title="Exercises">Exercises</a></li>
<li class="page_item"><a href="#" title="Installation">Installation</a></li>
</ul>
</div><!-- .menu -->
</div><!-- #access -->
</div><!-- #wrapper -->
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="installing-the-necessary-software">
<h1>Installing the necessary software<a class="headerlink" href="#installing-the-necessary-software" title="Link to this heading">¶</a></h1>
<p>In order to do the exercises in this book, you will need Python, Git, and a
suitable text editor or <a class="reference internal" href="1_introduction.html#term-integrated-development-environment"><span class="xref std std-term">Integrated Development Environment</span></a>. Visual
Studio Code is recommended as the <a class="reference internal" href="1_introduction.html#term-IDE"><span class="xref std std-term">IDE</span></a>.</p>
<p>Instructions are provided here for Windows, MacOS, and Linux. Chromebook users
can follow the Linux instructions if they first <a class="reference external" href="https://support.google.com/chromebook/answer/9145439">activate Linux on their
Chromebook</a>.</p>
<section id="homebrew-for-mac">
<h2>Homebrew for Mac<a class="headerlink" href="#homebrew-for-mac" title="Link to this heading">¶</a></h2>
<p>The easiest way to install additional programming software on a Mac is to first
install the Homebrew package manager. Open a terminal (press <kbd class="kbd docutils literal notranslate">⌘</kbd> +
<kbd class="kbd docutils literal notranslate">space</kbd> to open Spotlight Search and then type <code class="xref py py-obj docutils literal notranslate"><span class="pre">terminal</span></code> in the search
window) and run the following command:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>/bin/bash<span class="w"> </span>-c<span class="w"> </span><span class="s2">"</span><span class="k">$(</span>curl<span class="w"> </span>-fsSL<span class="w"> </span>https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh<span class="k">)</span><span class="s2">"</span>
</pre></div>
</div>
<p>Don’t type the <kbd class="kbd docutils literal notranslate">$</kbd>. That’s the terminal prompt (it might appear as another
symbol such as <kbd class="kbd docutils literal notranslate">%</kbd> for you).</p>
<p>This will start the install process, and ask you for confirmation before
installing Homebrew.</p>
<p>Further documentation about Homebrew and its dependencies is available on the
<a class="reference external" href="https://brew.sh">Homebrew website</a>.</p>
</section>
<section id="python">
<h2>Python<a class="headerlink" href="#python" title="Link to this heading">¶</a></h2>
<p>There are a number of different ways of obtaining Python, depending a little on
which operating system your computer runs. The routes suggested here are ones
that have been easiest for students taking the course at Imperial, however any
sufficiently recent Python should be sufficient.</p>
<section id="windows">
<h3>Windows<a class="headerlink" href="#windows" title="Link to this heading">¶</a></h3>
<p>Install <a class="reference external" href="https://apps.microsoft.com/detail/9ncvdn91xzqp">Python from the Microsoft Store</a>.</p>
</section>
<section id="macos">
<h3>MacOS<a class="headerlink" href="#macos" title="Link to this heading">¶</a></h3>
<p>MacOS comes with Python 3, but it’s a cut down version not suitable for our
purposes. Instead, install Python from Homebrew:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>python3.12
</pre></div>
</div>
</section>
<section id="linux">
<h3>Linux<a class="headerlink" href="#linux" title="Link to this heading">¶</a></h3>
<p>Every Linux distribution ships with Python 3 by default. However, they don’t
always have the Python package manager Pip installed by default. We will need
that so you’ll need to use your distribution’s package manager to install it.
For example on Ubuntu or Debian you would run:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>apt<span class="w"> </span>install<span class="w"> </span>python3-pip
</pre></div>
</div>
<p>You can also install newer versions of Python on Ubuntu or Debian using the
<a class="reference external" href="https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa">dead snakes package archive</a>.</p>
<p>On Fedora and related distributions you would run:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>dnf<span class="w"> </span>install<span class="w"> </span>python-pip
</pre></div>
</div>
</section>
</section>
<section id="git">
<h2>Git<a class="headerlink" href="#git" title="Link to this heading">¶</a></h2>
<p>Git is a revision control system. Revision control systems enable you to keep
track of the different versions of a piece of code as you work on them, and to
have these versions on different computers as well as backed up in the cloud. We
will use Git and GitHub classroom as a mechanism for distributing, working with
and submitting code exercises.</p>
<section id="id1">
<h3>Windows<a class="headerlink" href="#id1" title="Link to this heading">¶</a></h3>
<p>Download and install the <a class="reference external" href="https://git-scm.com/download/win">Git package</a>.</p>
</section>
<section id="id2">
<h3>MacOS<a class="headerlink" href="#id2" title="Link to this heading">¶</a></h3>
<p>MacOS comes with a perfectly acceptable Git installation. However you can also
install a more recent version from Homebrew:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>git
</pre></div>
</div>
</section>
<section id="id3">
<h3>Linux<a class="headerlink" href="#id3" title="Link to this heading">¶</a></h3>
<p>Use your distribution package manager to install Git. For example on Ubuntu or
Debian:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo apt install git-all
</pre></div>
</div>
<p>On Fedora:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ sudo apt install git-all
</pre></div>
</div>
</section>
</section>
<section id="visual-studio-code">
<h2>Visual Studio Code<a class="headerlink" href="#visual-studio-code" title="Link to this heading">¶</a></h2>
<p>Visual Studio Code is a Python-aware Integrated Development Environment (IDE).
This means that it incorporates editing files with other programming features
such as <a class="reference internal" href="8_debugging.html#debugging"><span class="std std-ref">Debugging and testing</span></a>, Git support, and built-in terminal.</p>
<section id="id4">
<h3>Windows<a class="headerlink" href="#id4" title="Link to this heading">¶</a></h3>
<p><a class="reference external" href="https://code.visualstudio.com/download">Download and install the package</a>.</p>
</section>
<section id="id5">
<h3>MacOS<a class="headerlink" href="#id5" title="Link to this heading">¶</a></h3>
<p>Use Homebrew to install Visual Studio Code:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>visual-studio-code
</pre></div>
</div>
</section>
<section id="id6">
<h3>Linux<a class="headerlink" href="#id6" title="Link to this heading">¶</a></h3>
<p><a class="reference external" href="https://code.visualstudio.com/download">Download the package</a> and then use
your package manager to install it <a class="reference external" href="https://code.visualstudio.com/docs/setup/linux">following these instructions</a>.</p>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
© Copyright 2019-2023, David A. Ham.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.7.
</div>
</body>
</html>