Configuring Canopy to run EPD as the User Python environment

Canopy 1.6 or greater can be configured to use EPD 7.5 or greater as Canopy's User Python environment. 

This article is focused on a single-user setup. For use with a multi-user (common install) setup, see Installing a Canopy Common Install to work with Canopy's stand-alone Python distribution (EPD).

 

The following instructions are for Windows and Linux because there is not currently an EPD installer for OSX.

These instructions assume the following and should be modified to correspond to your system's configuration:

  • EPD is installed at C:\PYTHON27 for Windows and /opt/EPD for Linux  
  • Canopy's Core Python environment is installed at %localappdata%/Enthought/Canopy/App for Windows and ~/Canopy for Linux.

Whenever multiple python installations are used on a system, it is important to avoid conflicting cross-references between them, by ensuring that the global environment variables do not refer to any of these installations. Specifically, there should be no reference to EPD or Canopy or other pythons in the PATH, PYTHONPATH, or PYTHONHOME environment variables, except when set temporarily for running a particular Python. The environment can be inspected by running set | sort on Windows and env | sort on Linux from the shell. On Windows, we suggest using Rapid Environment Editor to make changes in environment variables. 

On Windows, the registry should also be checked for references to any existing python 2.7 installation. This can be done with the following commands:

reg query HKCU\Software\Python\PythonCore\2.7 /s
reg query HKLM\Software\Python\PythonCore\2.7 /s

If either of these commands return keys with values pointing to an existing python installation, it is best to rename the key (e.g. to HLKM\Software\PythonCore\2.7old ) to disable it. (Renaming instead of deleting ensures that you can easily revert it if you want).

Caution:You can modify the Windows registry by running regedit from Run in the Start Menu and then navigating to the desired key path. Be very careful when editing the registry. If you are not comfortable navigating and making changes to the registry, enlist the help of someone who is.

 

While installing Canopy (Windows only):

EPD can be set to the User Python environment during Canopy's installation by running the following command at the Command Prompt.

msiexec /qr /lv*x canopy-msi.log /i canopy-1.7.4-win-64.msi SETUP_USER_PYTHON="C:\PYTHON27\pythonw.exe" 

If Canopy subsequently fails to start, with an error message about the kernel interpreter, then you've probably specified the SETUP_USER_PYTHON option incorrectly.  

After installing Canopy (Windows and Linux):

An existing installation of Canopy can be configured to use EPD as the User Python environment by running:

Windows:

"%localappdata%\enthought\canopy\app\canopy_cli" post-install-setup --user-python "C:\PYTHON27\pythonw.exe"

Linux:

~/Canopy/canopy_cli post-install-setup --user-python /app/EPD/bin/python

If Canopy subsequently fails to start, with an error message about the kernel interpreter, then you've probably specified the "--user-python" option incorrectly.  

Reverting back to Canopy's User Python environment:

To revert back to Canopy's User Python environment you can edit preferences.ini located at:

Windows: %localappdata%\enthought\canopy\app

Linux: ~/Canopy

Close Canopy and open preferences.ini and remove the following line from the [python_frontend] section:

interpreter = <path\to\epd>

The next time Canopy is started, Canopy's User Python environment will be running in the Editor's Python Pane.

 

More information can be found at: Canopy CLI post-install-setup options.

Have more questions? Submit a request

Comments

Powered by Zendesk