.. _python_environments:
Switching Python Environments
=============================
A Python environment consists of a Python interpreter and a collection
of packages, including any custom packages installed by the user.
In Canopy's context, Python environments are also referred to as EDM
environments, because Canopy internally uses embedded
`EDM (Enthought Deployment Manager)
`__
to create and manage Python environments.
Canopy 2.1 supports switching between different Python environments. The
Python Environment used by Canopy by default is named "**User**".
The option to switch the Python environment used by Canopy can be found under
**Menu -> Preferences -> Python tab -> Python Interpreter used by Canopy**,
as shown in this screen shot:
.. image:: python-env-preferences.png
:width: 550px
1. **Use Default Canopy Environment:** When this is checked, Canopy will use
the default Python Environment i.e. "User". When unchecked, Canopy will use a
non-default Python Environment i.e. an environment which the user created.
2. **EDM Environment to use:** The environment currently selected in this
drop-down is the environment that Canopy is currently using, i.e.
the environment that the Canopy Package Manager, IPython console, Debugger,
Data Import Tool, and Canopy Command Prompt / Terminal work with.
If you wish to work with a different environment, select it
from the drop-down list and click OK. You will need to restart
Canopy in order to begin using the newly selected environment.
3. **Create New Environment:** You can create a new Python environment for use
in Canopy by using this button. When clicked, a dialog will appear
asking you for further actions as mentioned below.
* **Enter the Name of the new Python Environment:** Input a name for the new
Python environment you wish to create. Try to keep the environment name
concise. Please use only alphanumeric characters, underscores, and hyphens,
as using spaces or punctuation could make the environment unusable.
* **Create Same as Original:** Clicking this will create the new environment
to be the same as the default (User) environment in a clean installation
of Canopy. This action does not require internet connectivity.
* **Select EDM Bundle File ...:** If you have an EDM bundle file, you can
use this option to create the new environment using it. This action
caches the Python runtime and package files for subsequent use. There are
two kinds of EDM bundle file, as described in
`"EDM bundles" `__
in the EDM documentation. Installing from a (large) data bundle file does
not require internet connectivity; installing from a (small)
metadata-only bundle file **does** require internet connectivity.
Creating a new Python environment can take between 2 and
10 minutes, based on your system's configuration and package history.
**Delete Selected Environment:** Clicking this button will delete the selected
environment in the "EDM Environment to use" drop-down. You cannot delete the
currently active environment.
For more details, see
`"Managing and switching between Python 2.7 and 3.5 environments"
`__
in the Enthought Support Knowledge Base.