@@ -74,7 +74,7 @@ of NumPy, Scipy and Matplotlib means that these packages are difficult to
74
74
upgrade (see `system python packages `_). For that reason we strongly suggest
75
75
that you install a fresh version of Python and use that as the basis for
76
76
installing libraries such as NumPy and Matplotlib. One convenient way to
77
- install matplotlib with other useful Python software is to use one of the
77
+ install Matplotlib with other useful Python software is to use one of the
78
78
excellent Python scientific software collections that are now available:
79
79
80
80
.. _system python packages :
@@ -108,62 +108,24 @@ or Python.org Python.
108
108
Installing OSX binary wheels
109
109
----------------------------
110
110
111
- If you are using recent Python from https://www.python.org, Macports or
112
- Homebrew, then you can use the standard pip installer to install Matplotlib
113
- binaries in the form of wheels.
111
+ If you are using Python from https://www.python.org, Homebrew, or Macports,
112
+ then you can use the standard pip installer to install Matplotlib binaries in
113
+ the form of wheels.
114
114
115
- Python.org Python
116
- ^^^^^^^^^^^^^^^^^
117
-
118
- Install pip following the `standard pip install instructions
119
- <https://pip.readthedocs.io/en/latest/installing/> `_. For the impatient,
120
- open a new Terminal.app window and::
121
-
122
- curl -O https://bootstrap.pypa.io/get-pip.py
123
-
124
- Then (Python 2)::
125
-
126
- python get-pip.py
127
-
128
- or (Python 3)::
129
-
130
- python3 get-pip.py
131
-
132
- You can now install matplotlib and all its dependencies with ::
133
-
134
- python -mpip install matplotlib
135
-
136
- or ::
137
-
138
- python3 -mpip install matplotlib
139
-
140
- Macports Python
141
- ^^^^^^^^^^^^^^^
142
-
143
- For Python 2::
144
-
145
- sudo port install py27-pip
146
- sudo python2 -mpip install matplotlib
147
-
148
- For Python 3::
115
+ pip is installed by default with python.org and Homebrew Python, but needs to
116
+ be manually installed on Macports with ::
149
117
150
118
sudo port install py36-pip
151
- sudo python3.6 -mpip install matplotlib
152
-
153
- Homebrew Python
154
- ^^^^^^^^^^^^^^^
155
-
156
- For Python 2::
157
-
158
- python2 -mpip install matplotlib
159
119
160
- For Python 3::
120
+ Once pip is installed, you can install Matplotlib and all its dependencies with
121
+ from the Terminal.app command line::
161
122
162
123
python3 -mpip install matplotlib
163
124
164
- You might also want to install IPython or the Jupyter notebook (``pythonX -mpip
165
- install ipython ``, ``pythonX -mpip install notebook ``, where ``pythonX `` is set
166
- as above).
125
+ (``sudo python3.6 ... `` on Macports).
126
+
127
+ You might also want to install IPython or the Jupyter notebook (``python3 -mpip
128
+ install ipython notebook ``).
167
129
168
130
pip problems
169
131
^^^^^^^^^^^^
@@ -178,39 +140,30 @@ Checking your installation
178
140
--------------------------
179
141
180
142
The new version of Matplotlib should now be on your Python "path". Check this
181
- with one of these commands at the Terminal.app command line::
182
-
183
- python2 -c 'import matplotlib; print matplotlib.__version__, matplotlib.__file__'
184
-
185
- (Python 2) or::
143
+ at the Terminal.app command line::
186
144
187
145
python3 -c 'import matplotlib; print(matplotlib.__version__, matplotlib.__file__)'
188
146
189
- (Python 3). You should see something like this ::
147
+ You should see something like ::
190
148
191
- 2.1 .0 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/__init__.pyc
149
+ 3.0 .0 /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/__init__.py
192
150
193
- where ``2.1 .0 `` is the Matplotlib version you just installed, and the path
151
+ where ``3.0 .0 `` is the Matplotlib version you just installed, and the path
194
152
following depends on whether you are using Python.org Python, Homebrew or
195
- Macports. If you see another version, or you get an error like this ::
153
+ Macports. If you see another version, or you get an error like ::
196
154
197
155
Traceback (most recent call last):
198
156
File "<string>", line 1, in <module>
199
157
ImportError: No module named matplotlib
200
158
201
- then check that the Python binary is the one you expected by doing one of
202
- these commands in Terminal.app::
203
-
204
- which python2
205
-
206
- or::
159
+ then check that the Python binary is the one you expected by running ::
207
160
208
161
which python3
209
162
210
- If you get the result ``/usr/bin/python2.7 ``, then you are getting the Python
211
- installed with OSX, which is probably not what you want. Try closing and
212
- restarting Terminal.app before running the check again. If that doesn't fix the
213
- problem, depending on which Python you wanted to use, consider reinstalling
163
+ If you get a result like ``/usr/bin/python... ``, then you are getting the
164
+ Python installed with OSX, which is probably not what you want. Try closing
165
+ and restarting Terminal.app before running the check again. If that doesn't fix
166
+ the problem, depending on which Python you wanted to use, consider reinstalling
214
167
Python.org Python, or check your homebrew or macports setup. Remember that
215
168
the disk image installer only works for Python.org Python, and will not get
216
169
picked up by other Pythons. If all these fail, please :ref: `let us know
0 commit comments