# Installing Canopy 2 on Windows for classroom/lab use

For administrative and technical background, please see "Canopy 2 Managed Common Install".

## Prep

Uninstall any existing EPD and Canopy installations on this system, including manually deleting all Canopy v1 System and User environment directories for each administrator and user.

Back up and then delete each user's Canopy configuration/preference directory, usually "C:\Users\<userid>\AppData\Roaming\Enthought\Canopy". For more details about directory locations, see Uninstalling and resetting Canopy v2.

Canopy 2.1.9 (or later) standard installer for Windows 64-bit from the Canopy download page. If you are a paid subscriber, and will not be able to update packages (because you are disconnected or because of administrative constraints), you may install the full installer instead, although otherwise this is not recommended.

## Install

1) Open an elevated command prompt (i.e. cmd.exe "Run as Administrator"), as described in this Knowledge Base article: "Windows - on some systems, admin users cannot immediately install 'for all users'". Do not open an enhanced console window such as conemu or console2.

2) Create the Canopy target directory (by default, "C:\Program Files\Enthought") with appropriate permissions. Typically you would give non-admin users read/execute access only, which would be the system default.

3) To the extent possible, temporarily disable your anti-virus software, or whitelist Canopy and Canopy Python. The next step installs tens of thousands of files and if they are all being scanned and checked in the cloud, the process will be very slow at best, and could possibly fail.

4) Install Canopy and set up the managed common install, with the following long one-line command, adjusting file names and paths as appropriate and making other changes as described below. Note that the quotation marks around string options (paths) are required:

msiexec /qr /Lv*x canopy-msi.log /i canopy-2.1.9.win-x86_64-cp27.msi ALLUSERS=1 SETUP_MANAGED_COMMON_INSTALL="C:\Program Files\Enthought" SETUP_LICENSE_PATH="C:\full\path\to\my-site-license-file.enlic"

4a) The default, and recommended, directory for installing for all users is C:\Program Files\Enthought. To install Canopy for all users into a different directory, specify it with option APPLICATIONFOLDER="<wherever>", and modify option SETUP_MANAGED_COMMON_INSTALL to point to the same directory. (Note that if you do this, and then later uninstall Canopy, you will need to again explicitly specify to msiexec, the same APPLICATIONFOLDER; this requirement should be removed in a future release, with a smarter uninstaller.)

4b) If you do have a license file (see Download, above), substitute its filename and current location (typically a download dir) above. If you don't, then omit the option SETUP_LICENSE_PATH="..."

Warning: Because of Windows idiosyncrasies, it's essential that you not put a closing backslash character at the end of any of the paths which you pass to msiexec.

## Directory structure

The directory structure in this example, resulting from this installation, would be:

C:\Program Files\Enthought\Canopy\       |- App # - Canopy Core (Canopy GUI application)      |- edm\envs\User # - Canopy User Python

## Usage

• All users may start Canopy from the Desktop shortcut, or from the command line with:
"C:\Program Files\Enthought\Canopy\App\Canopy.exe"
• From the Canopy GUI's Tool menu, they can open a Canopy Command Prompt window, running a shell where the GUI's active Python environment (by default, the environment named "User") is the default python.

• Or they can spawn such a shell in a regular Windows Command Prompt, without first starting the GUI, with:
"C:/Program Files/Enthought/Canopy/app/canopy_cli.exe" edm shell -e User
• Or they can activate Canopy's "User" Python (make it the default python) in an open Command Prompt window, with:
"C:/Program Files/Enthought/Canopy/edm/envs/User/Scripts/activate.bat"
• Or they can directly run Canopy's "User" Python with:
"C:/Program Files/Enthought/Canopy/edm/envs/User/python.exe"

## Update / maintain packages

To update packages in Canopy's active Python environment:

0) Ensure that no other users have this Canopy installation open.

1) Start Canopy "As Administrator" (e.g. right-click on its desktop icon and select "Run as Administrator")

2) From the Canopy Tools menu, open a Canopy Command Prompt window. Its title bar will read "Administrator: Canopy Command Prompt".

3) In this Canopy Command Prompt window, type:
edm mark-read-write

4) Keep this Canopy Command Prompt window open.

5) Update packages in one of two ways:

• From the Canopy Tools menu or Welcome screen, open the Canopy Package Manager, and use it to update packages.
• Or, in the Canopy Command Prompt window, use the edm command-line utility to update packages. See "Managing packages from the command line using EDM", in the Canopy documentation.

6) In the Canopy Command Prompt windows, type:
edm mark-read-only

7) Close the Canopy Command Prompt window.