Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 9955584118b2135ac21554fe39454ae6 > files > 341

python2-bson-3.7.2-1.mga7.armv7hl.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Installing / Upgrading &#8212; PyMongo 3.7.2 documentation</title>
    <link rel="stylesheet" href="_static/pydoctheme.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    
    <script type="text/javascript" src="_static/sidebar.js"></script>
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Tutorial" href="tutorial.html" />
    <link rel="prev" title="Using PyMongo with MongoDB Atlas" href="atlas.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="tutorial.html" title="Tutorial"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="atlas.html" title="Using PyMongo with MongoDB Atlas"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">PyMongo 3.7.2 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="installing-upgrading">
<h1>Installing / Upgrading<a class="headerlink" href="#installing-upgrading" title="Permalink to this headline">¶</a></h1>
<p><strong>PyMongo</strong> is in the <a class="reference external" href="http://pypi.python.org/pypi/pymongo/">Python Package Index</a>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last"><strong>Do not install the “bson” package from pypi.</strong> PyMongo comes
with its own bson package; doing “pip install bson” or “easy_install bson”
installs a third-party package that is incompatible with PyMongo.</p>
</div>
<div class="section" id="installing-with-pip">
<h2>Installing with pip<a class="headerlink" href="#installing-with-pip" title="Permalink to this headline">¶</a></h2>
<p>We recommend using <a class="reference external" href="http://pypi.python.org/pypi/pip">pip</a>
to install pymongo on all platforms:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install pymongo
</pre></div>
</div>
<p>To get a specific version of pymongo:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install <span class="nv">pymongo</span><span class="o">==</span><span class="m">3</span>.5.1
</pre></div>
</div>
<p>To upgrade using pip:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install --upgrade pymongo
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">pip does not support installing python packages in .egg format. If you would
like to install PyMongo from a .egg provided on pypi use easy_install
instead.</p>
</div>
</div>
<div class="section" id="installing-with-easy-install">
<h2>Installing with easy_install<a class="headerlink" href="#installing-with-easy-install" title="Permalink to this headline">¶</a></h2>
<p>To use <code class="docutils literal notranslate"><span class="pre">easy_install</span></code> from
<a class="reference external" href="http://pypi.python.org/pypi/setuptools">setuptools</a> do:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m easy_install pymongo
</pre></div>
</div>
<p>To upgrade do:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m easy_install -U pymongo
</pre></div>
</div>
</div>
<div class="section" id="dependencies">
<h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h2>
<p>PyMongo supports CPython 2.6, 2.7, 3.4+, PyPy, and PyPy3.</p>
<p>Optional dependencies:</p>
<p>GSSAPI authentication requires <a class="reference external" href="https://pypi.python.org/pypi/pykerberos">pykerberos</a> on Unix or <a class="reference external" href="https://pypi.python.org/pypi/winkerberos">WinKerberos</a> on Windows. The correct
dependency can be installed automatically along with PyMongo:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install pymongo<span class="o">[</span>gssapi<span class="o">]</span>
</pre></div>
</div>
<p>Support for mongodb+srv:// URIs requires <a class="reference external" href="https://pypi.python.org/pypi/dnspython">dnspython</a>:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install pymongo<span class="o">[</span>srv<span class="o">]</span>
</pre></div>
</div>
<p>TLS / SSL support may require <a class="reference external" href="https://pypi.python.org/pypi/ipaddress">ipaddress</a> and <a class="reference external" href="https://pypi.python.org/pypi/certifi">certifi</a> or <a class="reference external" href="https://pypi.python.org/pypi/wincertstore">wincertstore</a> depending on the Python
version in use. The necessary dependencies can be installed along with
PyMongo:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install pymongo<span class="o">[</span>tls<span class="o">]</span>
</pre></div>
</div>
<p>Wire protocol compression with snappy requires <a class="reference external" href="https://pypi.org/project/python-snappy">python-snappy</a>:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install pymongo<span class="o">[</span>snappy<span class="o">]</span>
</pre></div>
</div>
<p>You can install all dependencies automatically with the following
command:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install pymongo<span class="o">[</span>snappy,gssapi,srv,tls<span class="o">]</span>
</pre></div>
</div>
<p>Other optional packages:</p>
<ul class="simple">
<li><a class="reference external" href="https://pypi.python.org/pypi/backports.pbkdf2/">backports.pbkdf2</a>,
improves authentication performance with SCRAM-SHA-1 and SCRAM-SHA-256.
It especially improves performance on Python versions older than 2.7.8.</li>
<li><a class="reference external" href="https://pypi.python.org/pypi/monotonic">monotonic</a> adds support for
a monotonic clock, which improves reliability in environments
where clock adjustments are frequent. Not needed in Python 3.</li>
</ul>
</div>
<div class="section" id="installing-from-source">
<h2>Installing from source<a class="headerlink" href="#installing-from-source" title="Permalink to this headline">¶</a></h2>
<p>If you’d rather install directly from the source (i.e. to stay on the
bleeding edge), install the C extension dependencies then check out the
latest source from GitHub and install the driver from the resulting tree:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ git clone git://github.com/mongodb/mongo-python-driver.git pymongo
$ <span class="nb">cd</span> pymongo/
$ python setup.py install
</pre></div>
</div>
<div class="section" id="installing-from-source-on-unix">
<h3>Installing from source on Unix<a class="headerlink" href="#installing-from-source-on-unix" title="Permalink to this headline">¶</a></h3>
<p>To build the optional C extensions on Linux or another non-macOS Unix you must
have the GNU C compiler (gcc) installed. Depending on your flavor of Unix
(or Linux distribution) you may also need a python development package that
provides the necessary header files for your version of Python. The package
name may vary from distro to distro.</p>
<p>Debian and Ubuntu users should issue the following command:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo apt-get install build-essential python-dev
</pre></div>
</div>
<p>Users of Red Hat based distributions (RHEL, CentOS, Amazon Linux, Oracle Linux,
Fedora, etc.) should issue the following command:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo yum install gcc python-devel
</pre></div>
</div>
</div>
<div class="section" id="installing-from-source-on-macos-osx">
<h3>Installing from source on macOS / OSX<a class="headerlink" href="#installing-from-source-on-macos-osx" title="Permalink to this headline">¶</a></h3>
<p>If you want to install PyMongo with C extensions from source you will need
the command line developer tools. On modern versions of macOS they can be
installed by running the following in Terminal (found in
/Applications/Utilities/):</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>xcode-select --install
</pre></div>
</div>
<p>For older versions of OSX you may need Xcode. See the notes below for various
OSX and Xcode versions.</p>
<p><strong>Snow Leopard (10.6)</strong> - Xcode 3 with ‘UNIX Development Support’.</p>
<p><strong>Snow Leopard Xcode 4</strong>: The Python versions shipped with OSX 10.6.x
are universal binaries. They support i386, PPC, and (in the case of python2.6)
x86_64. Xcode 4 removed support for PPC, causing the distutils version shipped
with Apple’s builds of Python to fail to build the C extensions if you have
Xcode 4 installed. There is a workaround:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># For Apple-supplied Python2.6 (installed at /usr/bin/python2.6) and</span>
<span class="c1"># some builds from python.org</span>
$ env <span class="nv">ARCHFLAGS</span><span class="o">=</span><span class="s1">&#39;-arch i386 -arch x86_64&#39;</span> python -m easy_install pymongo
</pre></div>
</div>
<p>See <a class="reference external" href="http://bugs.python.org/issue11623">http://bugs.python.org/issue11623</a>
for a more detailed explanation.</p>
<p><strong>Lion (10.7) and newer</strong> - PyMongo’s C extensions can be built against
versions of Python 2.7 &gt;= 2.7.4 or Python 3.4+ downloaded from
python.org. In all cases Xcode must be installed with ‘UNIX Development
Support’.</p>
<p><strong>Xcode 5.1</strong>: Starting with version 5.1 the version of clang that ships with
Xcode throws an error when it encounters compiler flags it doesn’t recognize.
This may cause C extension builds to fail with an error similar to:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>clang: error: unknown argument: <span class="s1">&#39;-mno-fused-madd&#39;</span> <span class="o">[</span>-Wunused-command-line-argument-hard-error-in-future<span class="o">]</span>
</pre></div>
</div>
<p>There are workarounds:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># Apple specified workaround for Xcode 5.1</span>
<span class="c1"># easy_install</span>
$ <span class="nv">ARCHFLAGS</span><span class="o">=</span>-Wno-error<span class="o">=</span>unused-command-line-argument-hard-error-in-future easy_install pymongo
<span class="c1"># or pip</span>
$ <span class="nv">ARCHFLAGS</span><span class="o">=</span>-Wno-error<span class="o">=</span>unused-command-line-argument-hard-error-in-future pip install pymongo

<span class="c1"># Alternative workaround using CFLAGS</span>
<span class="c1"># easy_install</span>
$ <span class="nv">CFLAGS</span><span class="o">=</span>-Qunused-arguments easy_install pymongo
<span class="c1"># or pip</span>
$ <span class="nv">CFLAGS</span><span class="o">=</span>-Qunused-arguments pip install pymongo
</pre></div>
</div>
</div>
<div class="section" id="installing-from-source-on-windows">
<h3>Installing from source on Windows<a class="headerlink" href="#installing-from-source-on-windows" title="Permalink to this headline">¶</a></h3>
<p>If you want to install PyMongo with C extensions from source the following
requirements apply to both CPython and ActiveState’s ActivePython:</p>
<div class="section" id="bit-windows">
<h4>64-bit Windows<a class="headerlink" href="#bit-windows" title="Permalink to this headline">¶</a></h4>
<p>For Python 3.5 and newer install Visual Studio 2015. For Python 3.4
install Visual Studio 2010. You must use the full version of Visual Studio
2010 as Visual C++ Express does not provide 64-bit compilers. Make sure that
you check the “x64 Compilers and Tools” option under Visual C++. For Python 2.6
and 2.7 install the <a class="reference external" href="https://www.microsoft.com/en-us/download/details.aspx?id=44266">Microsoft Visual C++ Compiler for Python 2.7</a>.</p>
</div>
<div class="section" id="id1">
<h4>32-bit Windows<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h4>
<p>For Python 3.5 and newer install Visual Studio 2015.</p>
<p>For Python 3.4 install Visual C++ 2010 Express.</p>
<p>For Python 2.6 and 2.7 install the <a class="reference external" href="https://www.microsoft.com/en-us/download/details.aspx?id=44266">Microsoft Visual C++ Compiler for Python 2.7</a></p>
</div>
</div>
</div>
<div class="section" id="installing-without-c-extensions">
<span id="install-no-c"></span><h2>Installing Without C Extensions<a class="headerlink" href="#installing-without-c-extensions" title="Permalink to this headline">¶</a></h2>
<p>By default, the driver attempts to build and install optional C
extensions (used for increasing performance) when it is installed. If
any extension fails to build the driver will be installed anyway but a
warning will be printed.</p>
<p>If you wish to install PyMongo without the C extensions, even if the
extensions build properly, it can be done using a command line option to
<em>setup.py</em>:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python setup.py --no_ext install
</pre></div>
</div>
</div>
<div class="section" id="building-pymongo-egg-packages">
<h2>Building PyMongo egg Packages<a class="headerlink" href="#building-pymongo-egg-packages" title="Permalink to this headline">¶</a></h2>
<p>Some organizations do not allow compilers and other build tools on production
systems. To install PyMongo on these systems with C extensions you may need to
build custom egg packages. Make sure that you have installed the dependencies
listed above for your operating system then run the following command in the
PyMongo source directory:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python setup.py bdist_egg
</pre></div>
</div>
<p>The egg package can be found in the dist/ subdirectory. The file name will
resemble “pymongo-3.6-py2.7-linux-x86_64.egg” but may have a different name
depending on your platform and the version of python you use to compile.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">These “binary distributions,” will only work on systems that resemble the
environment on which you built the package. In other words, ensure that
operating systems and versions of Python and architecture (i.e. “32” or “64”
bit) match.</p>
</div>
<p>Copy this file to the target system and issue the following command to install the
package:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo python -m easy_install pymongo-3.6-py2.7-linux-x86_64.egg
</pre></div>
</div>
</div>
<div class="section" id="installing-a-beta-or-release-candidate">
<h2>Installing a beta or release candidate<a class="headerlink" href="#installing-a-beta-or-release-candidate" title="Permalink to this headline">¶</a></h2>
<p>MongoDB, Inc. may occasionally tag a beta or release candidate for testing by
the community before final release. These releases will not be uploaded to pypi
but can be found on the
<a class="reference external" href="https://github.com/mongodb/mongo-python-driver/tags">GitHub tags page</a>.
They can be installed by passing the full URL for the tag to pip:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m pip install https://github.com/mongodb/mongo-python-driver/archive/3.7.0b0.tar.gz
</pre></div>
</div>
<p>or easy_install:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ python -m easy_install https://github.com/mongodb/mongo-python-driver/archive/3.7.0b0.tar.gz
</pre></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Installing / Upgrading</a><ul>
<li><a class="reference internal" href="#installing-with-pip">Installing with pip</a></li>
<li><a class="reference internal" href="#installing-with-easy-install">Installing with easy_install</a></li>
<li><a class="reference internal" href="#dependencies">Dependencies</a></li>
<li><a class="reference internal" href="#installing-from-source">Installing from source</a><ul>
<li><a class="reference internal" href="#installing-from-source-on-unix">Installing from source on Unix</a></li>
<li><a class="reference internal" href="#installing-from-source-on-macos-osx">Installing from source on macOS / OSX</a></li>
<li><a class="reference internal" href="#installing-from-source-on-windows">Installing from source on Windows</a><ul>
<li><a class="reference internal" href="#bit-windows">64-bit Windows</a></li>
<li><a class="reference internal" href="#id1">32-bit Windows</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#installing-without-c-extensions">Installing Without C Extensions</a></li>
<li><a class="reference internal" href="#building-pymongo-egg-packages">Building PyMongo egg Packages</a></li>
<li><a class="reference internal" href="#installing-a-beta-or-release-candidate">Installing a beta or release candidate</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="atlas.html"
                        title="previous chapter">Using PyMongo with MongoDB Atlas</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="tutorial.html"
                        title="next chapter">Tutorial</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/installation.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="tutorial.html" title="Tutorial"
             >next</a> |</li>
        <li class="right" >
          <a href="atlas.html" title="Using PyMongo with MongoDB Atlas"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">PyMongo 3.7.2 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright MongoDB, Inc. 2008-present. MongoDB, Mongo, and the leaf logo are registered trademarks of MongoDB, Inc.
    </div>
  </body>
</html>