posted this on April 30, 2013, 15:26
Enthought Canopy is both a new graphical data analysis environment, and an update to the Enthought Python Distribution (EPD). While use of the Canopy graphical environment does require a display, Canopy can be installed and run on "headless" machines where only a command line is available. Two options exist.
Using Canopy via a remote X11 display
For users who want to use the graphical environment and have an X11 (X Window System) server available, Canopy can be set to display to a remote server. To do this, set the 'DISPLAY' environment variable, on the Canopy machine, to point to the machine the X11 server is running on. A typical setting looks like this (in Bash syntax):
where 192.168.1.2 is the IP address of the machine running the X11 server and ":0" refers to the screen number (zero in most cases).
Using Canopy purely from the command line as a Python environment
Canopy is based on the use of virtual environments. Virtual environments let users create what are effectively multiple, light-weight Python installations. The full Python environment, and a set of core packages, are available in the base environment (in this case the Canopy install itself). Users can then install packages into one or more separate virtual environments without having to duplicate the core.
In a typical Canopy GUI setup, two virtual environments ("System" for the Canopy GUI itself, and "User" for running your own programs) are created when Canopy is first started. You can read more about this configuration here.
In contrast, to use Canopy in a headless environment, you only need to set up a single virtual environment. In Canopy 1.1 (mid-August release) this setup will be streamlined. At present, it requires the following manual steps on Linux:
1. Install Canopy from the downloaded .sh script. This can be in your home directory, in a protected shared directory, or any other directory. Later, you will not need to have write access to this directory to install packages.
2. Run the following command (assumes you installed Canopy in the default ~/Canopy directory, adjust as needed):
This command creates a new virtual environment in ./canopy_1 (or wherever you specify).
3. Add ./canopy_1/bin to your PATH environment variable or, if you are using bash, you can type:
If you type `'which python'` you should now be using the Python from the virtual environment and you can use this, just as you would use EPD. To install new packages, just use the "enpkg" command as you would do in EPD.
While setting up a virtual environment requires an additional step, the advantage is that you can easily create multiple virtual environments to keep applications separate, or to experiment with new package versions without disrupting a known good environment. Again, this process will be streamlined in Canopy 1.1.