Skip to content

Commit bce08f9

Browse files
authored
Update python_for_mac.rst
1 parent ddd1acb commit bce08f9

1 file changed

Lines changed: 37 additions & 27 deletions

File tree

‎source/topics/01-setting_up/python_for_mac.rst‎

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ So we recommend installing a new version.
1717
**Note**:
1818

1919

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.*
2121

2222
If not, then read on.
2323

@@ -38,18 +38,22 @@ latest version, and you really don't want to mess with the system
3838
installation. So we recommend installing an independent installation from
3939
``python.org``:
4040

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:
4242

4343
https://www.python.org/downloads/
4444

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+
4547
Double click the installer and follow the prompts. The defaults are your best bet. Simple as that.
4648

4749
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:
4850

4951
.. code-block:: bash
5052
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)
5357

5458
Or an add an alias in your shell by adding the following line::
5559

@@ -62,7 +66,7 @@ Once you have done that, you should be able to type ``python`` at the command pr
6266
.. code-block:: bash
6367
6468
$ 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)
6670
[Clang 6.0 (clang-600.0.57)] on darwin
6771
Type "help", "copyright", "credits" or "license" for more information.
6872
>>>
@@ -123,9 +127,9 @@ Now you should now be able to run ``iPython``:
123127
.. code-block:: ipython
124128
125129
$ ipython
126-
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
130+
Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39)
127131
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.
129133
130134
In [1]:
131135
@@ -134,15 +138,20 @@ Which you can also get out of with ``ctrl+D`` or ``exit()``
134138
git
135139
----
136140

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.
138143

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.
140145

141146
There are a couple of options for a command line client.
142147

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!
144151

145-
http://sourceforge.net/projects/git-osx-installer/
152+
Ifyou only need git, this has everything you need out of the box, and is a 500(!) times smaller download.
153+
154+
https://sourceforge.net/projects/git-osx-installer/
146155

147156
NOTE: if you get a warning like:
148157

@@ -152,43 +161,38 @@ you'll need to go to system preferences:
152161

153162
"Security and Privacy"
154163

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.
162165

163166
After either of these is installed, the ``git`` command should work:
164167

165168
.. code-block:: bash
166169
167170
$ git --version
168-
git version 2.11.0 (Apple Git-81)
171+
git version 2.24.3 (Apple Git-128)
172+
169173
170174
Testing it out
171175
--------------
172176

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:
174178
- python
175179
- pip
176180
- iPython
177181
- git
178182

179183
To try it out, you should be able to run all of the following commands, and get something like the results shown:
180184

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()``
182186

183187
For Python:
184188
...........
185189

186190
.. code-block:: bash
187191
188192
$ python3
189-
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
193+
Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39)
190194
[Clang 6.0 (clang-600.0.57)] on darwin
191-
Type "help", "copyright", "credits" or "license" for more information.
195+
Type "help", "copyright", "credits" or "license" for more information.
192196
>>>
193197
194198
@@ -198,24 +202,30 @@ For iPython:
198202
.. code-block:: bash
199203
200204
$ ipython
201-
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
205+
Python 3.8.6 (v3.8.6:db455296be, Sep 23 2020, 13:31:39)
202206
Type 'copyright', 'credits' or 'license' for more information
203-
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.
207+
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.
208+
209+
In [1]:
204210
205211
For pip:
206212
........
207213

208214
.. code-block:: bash
209215
210216
$ python3 -m pip --version
211-
pip 18.0 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
217+
pip 20.2.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
212218
213219
Note that when you ask pip for ``--version`` it tells you which version of python it is "connected" to.
220+
Make sure that's the one you expect!
214221

215222
For git:
216223
........
217224

218225
.. code-block:: bash
219226
220227
$ git --version
221-
git version 2.15.2 (Apple Git-101.1)
228+
git version 2.24.3 (Apple Git-128)
229+
230+
231+
If those commands all run -- you are all set!

0 commit comments

Comments
 (0)