<commit_before>Installing DyNet for Python
===========================

Python bindings to DyNet are supported for both Python 2.x and 3.x.
Before installing DyNet, you will need to make sure that several packages are installed.
For example on **Ubuntu Linux**:

::
    
    sudo apt-get update
    sudo apt-get install python-pip build-essential cmake mercurial

Or on **macOS**, first make sure the Apple Command Line Tools are installed, then
get CMake, and Mercurial with either homebrew or macports:

::

    xcode-select --install
    brew install cmake hg python # Using homebrew.
    sudo port install cmake mercurial py-pip # Using macports.

On **Windows**, see :ref:`windows-python-install`.

(Currently, since the pip installation will build from source, you need to install
 cython ahead: ``pip install cython``.)
<commit_msg>Added mention of binary distribution (#1234)<commit_after>Installing DyNet for Python
===========================

Installing a Release CPU Version
--------------------------------

Python bindings to DyNet are supported for both Python 2.x and 3.x.
If you want to install a release version of DyNet and don't need to run on GPU, you can
simply run

::

    pip install dynet


Installing a Cutting-edge and/or GPU Version
--------------------------------------------

If you want the most recent features of DyNet from the development branch, or want GPU
compute capability, you'll want to install DyNet from source.

Before doing so, you will need to make sure that several packages are installed.
For example on **Ubuntu Linux**:

::
    
    sudo apt-get update
    sudo apt-get install python-pip build-essential cmake mercurial

Or on **macOS**, first make sure the Apple Command Line Tools are installed, then
get CMake, and Mercurial with either homebrew or macports:

::

    xcode-select --install
    brew install cmake hg python # Using homebrew.
    sudo port install cmake mercurial py-pip # Using macports.

On **Windows**, see :ref:`windows-python-install`.

(Currently, since the pip installation will build from source, you need to install
 cython ahead: ``pip install cython``.)

{'fraction_non_alphanumeric': 0.12213383247543284, 'fraction_numerical': 0.003743565746373421, 'mean_word_length': 3.4082474226804123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5134142', 'n_tokens_mistral': 587, 'n_tokens_neox': 540, 'n_words': 279}