You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bce08f9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: source/topics/01-setting_up/python_for_mac.rst
+37-27Lines changed: 37 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ So we recommend installing a new version.
17
17
**Note**:
18
18
19
19
20
-
If you use ``macports`` or ``homebrew`` to manage \*nix software on your machine, feel free to use those for ``python``, ``git``, etc, as well. But make sure you have Python 3.7.*
20
+
If you use ``macports`` or ``homebrew`` to manage \*nix software on your machine, feel free to use those for ``python``, ``git``, etc, as well. But make sure you have Python 3.8.*
21
21
22
22
If not, then read on.
23
23
@@ -38,18 +38,22 @@ latest version, and you really don't want to mess with the system
38
38
installation. So we recommend installing an independent installation from
39
39
``python.org``:
40
40
41
-
Download the latest realease of Python (currently 3.7.0) installer from Python.org:
41
+
Download the latest release of Python installer from Python.org:
42
42
43
43
https://www.python.org/downloads/
44
44
45
+
NOTE: As of this writting, version 3.9.0 was jsut released -- it will work fine. But we willnot be using any 3.9 features in this course, and examples will generally be in 3.8 -- so 3.8 or 3.9 is fine.
46
+
45
47
Double click the installer and follow the prompts. The defaults are your best bet. Simple as that.
46
48
47
49
Oddly, this does NOT install a ``python`` command, but rather a ``python3`` command. If you want to be able to simply type ``python`` and get python3, then you can add a symlink to the install. Type this at a terminal prompt:
48
50
49
51
.. code-block:: bash
50
52
51
-
$ cd /Library/Frameworks/Python.framework/Versions/3.7/bin
52
-
$ ln -s python3.7 python
53
+
$ cd /Library/Frameworks/Python.framework/Versions/3.8/bin
54
+
$ ln -s python3.8 python
55
+
56
+
(replace the 3.8 above with 3.9 if you have installed 3.9)
53
57
54
58
Or an add an alias in your shell by adding the following line::
55
59
@@ -62,7 +66,7 @@ Once you have done that, you should be able to type ``python`` at the command pr
62
66
.. code-block:: bash
63
67
64
68
$ python
65
-
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
69
+
Python 3.8.6 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
66
70
[Clang 6.0 (clang-600.0.57)] on darwin
67
71
Type "help", "copyright", "credits" or "license"for more information.
68
72
>>>
@@ -123,9 +127,9 @@ Now you should now be able to run ``iPython``:
123
127
.. code-block:: ipython
124
128
125
129
$ ipython
126
-
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
Type 'copyright', 'credits' or 'license' for more information
128
-
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.
132
+
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.
129
133
130
134
In [1]:
131
135
@@ -134,15 +138,20 @@ Which you can also get out of with ``ctrl+D`` or ``exit()``
134
138
git
135
139
----
136
140
137
-
git is a source code version control system. It is not strictly related to Python, but it (or a similar system) is a critical tool for software development in general, and it is very widely used in the Python community. We will be using it, along with the gitHub service, in the program to hand in assignments and support code review.
141
+
git is a source code version control system. It is not strictly related to Python, but it (or a similar system) is a critical tool for software development in general, and it is very widely used in the Python community.
142
+
We will be using it, along with the gitHub classroom service, in the program to hand in assignments and support code review.
138
143
139
-
You need a git client. The gitHub GUI client may be nice; I honestly don't know. However, we will be using the command line client in class.
144
+
You will need a git client. The gitHub GUI client may be nice; I honestly don't know. However, we will be using the command line client in class.
140
145
141
146
There are a couple of options for a command line client.
142
147
143
-
This option is a big download and install, but has everything you need out of the box:
148
+
https://git-scm.com/download/mac
149
+
150
+
Perhpas the easiest, particularly if you need a compiler for any other reason, is to get git as part of the XCode command line tools, You can install XCode from the App Store. But be forwarned -- it is a VERY big download: 11.2GB!
@@ -152,43 +161,38 @@ you'll need to go to system preferences:
152
161
153
162
"Security and Privacy"
154
163
155
-
Depending on the OS-X version, you will need to check the box saying "Open Anyway," or perhaps the box saying you can install untrusted packages.
156
-
157
-
This option works great, but you need the XCode command line tools to run it:
158
-
159
-
http://git-scm.com/download/mac
160
-
161
-
You can get XCode from the Apple App Store. If you try running "git" on the command line after installing, it should send you there. Warning: XCode is a BIG download. Once installed, run it so it can initialize itself.
164
+
Depending on the OS-X version, you will need to check the box saying "Open Anyway," or perhaps the box saying you can install untrusted packages.
162
165
163
166
After either of these is installed, the ``git`` command should work:
164
167
165
168
.. code-block:: bash
166
169
167
170
$ git --version
168
-
git version 2.11.0 (Apple Git-81)
171
+
git version 2.24.3 (Apple Git-128)
172
+
169
173
170
174
Testing it out
171
175
--------------
172
176
173
-
To be ready for the program, you need to have, all available from the command line:
177
+
To be ready for this course, you need to have, all available from the command line:
174
178
- python
175
179
- pip
176
180
- iPython
177
181
- git
178
182
179
183
To try it out, you should be able to run all of the following commands, and get something like the results shown:
180
184
181
-
(recall that you can get out of the Python or iPython command lines with ``ctrl+D``)
185
+
(recall that you can get out of the Python or iPython command lines with ``ctrl+D`` or ``exit()``
182
186
183
187
For Python:
184
188
...........
185
189
186
190
.. code-block:: bash
187
191
188
192
$ python3
189
-
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
0 commit comments