Installing packages into Canopy User Python from the OS command line
posted this on March 19, 2013 13:49
(updated April 2, 2014 )
You can install additional packages (either external or from the Canopy / EPD repository) into Canopy User Python from the OS (Windows/Mac/Linux) command line (terminal shell prompt).
The key point is that you must install into the Canopy User Python environment, not into Canopy's Core or System Python environments.
1. Be sure that you have updated to Canopy 1.2 or higher (using the Canopy help menu).
2. Ensure that Canopy User Python is on the shell PATH, i.e. that typing `python` at the prompt starts Canopy User Python, not another python. To check this, after you have started python from the OS command prompt / terminal window, type:
import sys sys.prefix
you should see a path which ends in something like "Canopy/User" (not "Canopy/System" or other paths).
Having confirmed this path, you can then exit from python and continue the installation from the OS command line.
3. If you are using Canopy 1.3 in Windows, you will need to begin with the following command, in a Canopy Command Prompt window, which can be opened from the Windows Start Menu (not the same as the Python command prompt inside of Canopy itself):
pip install --upgrade setuptools
4. To install a package which is not available in the Canopy / EPD repository, follow standard Python installation procedures from the OS command line.
Caution: Except as noted in (3) above, do not install setuptools in EPD or Canopy. Setuptools 0.6 is already supported, and higher versions are not yet compatible with Enthought installers. EPD / Canopy includes distribute 0.6.26, which simulates setuptools 0.6. If you install setuptools, then you will corrupt distribute and have problems. If you need to install a package which requires a version of setuptools greater than 0.6, please email us at email@example.com, explaining your needs and we will provide a solution if feasible. We will soon be building a new version of distribute which provides the necessary functionality.
5. If you are not installing a new package, but updating one that is already in Canopy to a version that is not yet available in our repository, please note this article.
6. With the PATH set as just described, you may also use the EPD/Canopy `enpkg` utility from the OS command line, in lieu of the Canopy package manager.
7. (Windows only) - starting with Canopy 1.0.3, binary package installers such as Chris Gohlke's work, provided that you have made Canopy your default Python as described in the article referenced in (2) above.
Packages installed using these non-Enthought installers will not be listed in the Package Manager, but they will be fully installed into, and usable in, Enthought Canopy User Python. We are reviewing options for listing them in the Package Manager in future versions of Canopy.
Please do not enter support requests in article comments
Please use article comments for suggestions to improve the article. For individual support requests, please follow these guidelines.