========================================
Setting up a default project environment
========================================

AEN includes a full installation of the Anaconda Python distribution---along
with several additional packages---located within the root conda environment
in ``/opt/wakari/anaconda``. A copy of this environment is created for each
new AEN Project.

To configure a different set of packages than the default:

#. Create a new conda environment in the ``/opt/wakari/anaconda/envs/default`` directory.

   EXAMPLE: Using a Python 3.4 base environment, run:

   .. code-block:: bash

      sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda \
          create -p /opt/wakari/anaconda/envs/default python=3.4

#. Use ``conda`` to install any additional packages into the environment.

#. After the environment is created, clone it to ensure that it works correctly:

   .. code-block:: bash

      sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda \
          create -p /opt/wakari/testenv --clone /opt/wakari/anaconda/envs/default
      sudo -u $AEN_SRVC_ACCT rm -rf /opt/wakari/testenv

The default project environment is cloned into the project workspace the first
time the project is started.

Converting an existing project
------------------------------

#. Run the following command to clone the environment:

   .. code-block:: bash

      sudo -u $AEN_SRVC_ACCT /opt/wakari/anaconda/bin/conda \
          create -n /projects/owner/project/envs/<ENV_NAME> \
          --clone /opt/wakari/anaconda/envs/default

   NOTE: Replace ``/projects/owner/project/envs/<ENV_NAME>`` with the path to
   the new environment you would like to create within the project.

#. Open the :doc:`Compute Resource Configuration application <../../../user-guide/basic-tasks/apps/use-crc>` for your project and set the project environment path there as well.
