Installing packages into Canopy User Python from the OS command line
posted this on March 19, 2013 13:49
(updated February 10, 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.0.4 or higher (using the Canopy help menu); there is a bug in 1.0.0 which can interfere with some installations of external packages, and 1.0.4 allows easier setting of PATH.
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 command prompt, 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.
Caution: 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 firstname.lastname@example.org, 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.
4. 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.
5. 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.
6. (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.