@@ -5,9 +5,9 @@ Installing / Upgrading
55**PyMongo ** is in the `Python Package Index
66<http://pypi.python.org/pypi/pymongo/> `_.
77
8- .. warning :: **Do not install the "bson" package.** PyMongo comes with its own
9- bson package; doing "pip install bson" or "easy_install bson" installs a
10- third-party package that is incompatible with PyMongo.
8+ .. warning :: **Do not install the "bson" package from pypi .** PyMongo comes
9+ with its own bson package; doing "pip install bson" or "easy_install bson"
10+ installs a third-party package that is incompatible with PyMongo.
1111
1212Installing with pip
1313-------------------
@@ -19,7 +19,7 @@ to install pymongo on all platforms::
1919
2020To get a specific version of pymongo::
2121
22- $ python -m pip install pymongo==3.1 .1
22+ $ python -m pip install pymongo==3.5 .1
2323
2424To upgrade using pip::
2525
@@ -80,21 +80,31 @@ Other optional packages:
8080- `backports.pbkdf2 <https://pypi.python.org/pypi/backports.pbkdf2/ >`_,
8181 improves authentication performance with SCRAM-SHA-1, the default
8282 authentication mechanism for MongoDB 3.0+. It especially improves
83- performance on Python older than 2.7.8, or on Python 3 before Python 3.4 .
83+ performance on Python versions older than 2.7.8.
8484- `monotonic <https://pypi.python.org/pypi/monotonic >`_ adds support for
8585 a monotonic clock, which improves reliability in environments
86- where clock adjustments are frequent. Not needed in Python 3.3+.
86+ where clock adjustments are frequent. Not needed in Python 3.
8787
8888
89- Dependencies for installing C Extensions on Unix
90- ------------------------------------------------
89+ Installing from source
90+ ----------------------
91+
92+ If you'd rather install directly from the source (i.e. to stay on the
93+ bleeding edge), install the C extension dependencies then check out the
94+ latest source from github and install the driver from the resulting tree::
95+
96+ $ git clone git://github.com/mongodb/mongo-python-driver.git pymongo
97+ $ cd pymongo/
98+ $ python setup.py install
99+
100+ Installing from source on Unix
101+ ..............................
91102
92- MongoDB, Inc. does not provide statically linked binary packages for Unix
93- flavors other than OSX. To build the optional C extensions you must have the
94- GNU C compiler (gcc) installed. Depending on your flavor of Unix (or Linux
95- distribution) you may also need a python development package that provides
96- the necessary header files for your version of Python. The package name may
97- vary from distro to distro.
103+ To build the optional C extensions on Linux or another non-macOS Unix you must
104+ have the GNU C compiler (gcc) installed. Depending on your flavor of Unix
105+ (or Linux distribution) you may also need a python development package that
106+ provides the necessary header files for your version of Python. The package
107+ name may vary from distro to distro.
98108
99109Debian and Ubuntu users should issue the following command::
100110
@@ -105,22 +115,18 @@ Fedora, etc.) should issue the following command::
105115
106116 $ sudo yum install gcc python-devel
107117
108- Installing from source
109- ----------------------
110-
111- If you'd rather install directly from the source (i.e. to stay on the
112- bleeding edge), install the C extension dependencies then check out the
113- latest source from github and install the driver from the resulting tree::
118+ Installing from source on macOS / OSX
119+ .....................................
114120
115- $ git clone git://github.com/mongodb/mongo-python-driver.git pymongo
116- $ cd pymongo/
117- $ python setup.py install
121+ If you want to install PyMongo with C extensions from source you will need
122+ the command line developer tools. On modern versions of macOS they can be
123+ installed by running the following in Terminal (found in
124+ /Applications/Utilities/)::
118125
119- Installing from source on OSX
120- .............................
126+ xcode-select --install
121127
122- If you want to install PyMongo from source on OSX you will have to install the
123- following to build the C extensions:
128+ For older versions of OSX you may need Xcode. See the notes below for various
129+ OSX and Xcode versions.
124130
125131**Snow Leopard (10.6) ** - Xcode 3 with 'UNIX Development Support'.
126132
@@ -173,11 +179,10 @@ requirements apply to both CPython and ActiveState's ActivePython:
173179~~~~~~~~~~~~~~
174180
175181For Python 3.5 and newer install Visual Studio 2015. For Python 3.4
176- install Visual Studio 2010. For Python 2.6 and 2.7 install Visual Studio
177- 2008, or the Microsoft Visual C++ Compiler for Python 2.7. You must use the
178- full version of Visual Studio 2010 or 2008 as Visual C++ Express does not
179- provide 64-bit compilers. Make sure that you check the "x64 Compilers and
180- Tools" option under Visual C++.
182+ install Visual Studio 2010. You must use the full version of Visual Studio
183+ 2010 as Visual C++ Express does not provide 64-bit compilers. Make sure that
184+ you check the "x64 Compilers and Tools" option under Visual C++. For Python 2.6
185+ and 2.7 install the `Microsoft Visual C++ Compiler for Python 2.7 `_.
181186
18218732-bit Windows
183188~~~~~~~~~~~~~~
@@ -186,7 +191,9 @@ For Python 3.5 and newer install Visual Studio 2015.
186191
187192For Python 3.4 install Visual C++ 2010 Express.
188193
189- For Python 2.6 and 2.7 install Visual C++ 2008 Express SP1.
194+ For Python 2.6 and 2.7 install the `Microsoft Visual C++ Compiler for Python 2.7 `_
195+
196+ .. _`Microsoft Visual C++ Compiler for Python 2.7` : https://www.microsoft.com/en-us/download/details.aspx?id=44266
190197
191198.. _install-no-c :
192199
0 commit comments