<commit_before>.. _anacondaDeveloperWindows:

*************************************************************
Installation by Source Using Anaconda Environment for Windows
*************************************************************


* Download and install the `Anaconda Python Platform <http://continuum.io/downloads>`_ for Python 2.7 (make sure not to install Python 3.0+, which is incompatible with RMG). We recommend changing the default install path to ``C:\Anaconda\`` in order to avoid spaces in the install path and be easily accessible. It is recommended to append Anaconda to your PATH as well as setting it as your default Python executable.  All other settings can remain as their defaults.

.. image:: images/AnacondaInstallWindows.png
    :align: center

* Install `Git <http://git-scm.com/download/win>`_, the open source version control package. You may configure everything with their defaults, but it is recommended to commit Unix-style line endings:

.. image:: images/InstallGit.png
    :align: center
    
* Open a command prompt (either by finding it in your Program Files or by searching for ``cmd.exe``).  Install the latest versions of RMG and RMG-database through cloning the source code via Git. Make sure to start in an appropriate local directory where you want both RMG-Py and RMG-database folders to exist. We recommend creating a folder such as ``C:\Code\`` ::

    git clone https://github.com/ReactionMechanismGenerator/RMG-Py.git
    git clone https://github.com/ReactionMechanismGenerator/RMG-database.git
    
* Create the RMG Anaconda environment ::
    
    cd RMG-Py
    conda env create -f environment_windows.yml

* Now you must install mingwpy and configure it, which is slightly tricky. ::


    activate rmg_env
    pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy

  Now generate the python27 unix-style library::

    cd C:\Anaconda\envs\rmg_env\
    gendef python27.dll
    dlltool -D python27.dll -d python27.def -l libs\libpython27.a

  Also point distutils to MinGW::

    echo -e "[build]\ncompiler=mingw32" > Lib\distutils\distutils.cfg

* Now you can compile RMG-Py ::
    
    cd RMG-Py<commit_msg>Doesn't require configuring distutils if running locally<commit_after>.. _anacondaDeveloperWindows:

*************************************************************
Installation by Source Using Anaconda Environment for Windows
*************************************************************


* Download and install the `Anaconda Python Platform <http://continuum.io/downloads>`_ for Python 2.7 (make sure not to install Python 3.0+, which is incompatible with RMG). We recommend changing the default install path to ``C:\Anaconda\`` in order to avoid spaces in the install path and be easily accessible. It is recommended to append Anaconda to your PATH as well as setting it as your default Python executable.  All other settings can remain as their defaults.

.. image:: images/AnacondaInstallWindows.png
    :align: center

* Install `Git <http://git-scm.com/download/win>`_, the open source version control package. You may configure everything with their defaults, but it is recommended to commit Unix-style line endings:

.. image:: images/InstallGit.png
    :align: center
    
* Open a command prompt (either by finding it in your Program Files or by searching for ``cmd.exe``).  Install the latest versions of RMG and RMG-database through cloning the source code via Git. Make sure to start in an appropriate local directory where you want both RMG-Py and RMG-database folders to exist. We recommend creating a folder such as ``C:\Code\`` ::

    git clone https://github.com/ReactionMechanismGenerator/RMG-Py.git
    git clone https://github.com/ReactionMechanismGenerator/RMG-database.git
    
* Create the RMG Anaconda environment ::
    
    cd RMG-Py
    conda env create -f environment_windows.yml

* Now you must install mingwpy and configure it, which is slightly tricky. ::


    activate rmg_env
    pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy

  Now generate the python27 unix-style library::

    cd C:\Anaconda\envs\rmg_env\
    gendef python27.dll
    dlltool -D python27.dll -d python27.def -l libs\libpython27.a

* Now you can compile RMG-Py ::
    
    cd RMG-Py
{'fraction_non_alphanumeric': 0.12830718801217514, 'fraction_numerical': 0.007024116132053383, 'mean_word_length': 4.0023419203747075, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2278365', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1123, 'n_words': 484}