Installing packages into an Enthought Python (EDM-installed) environment

The following instructions all assume that you have opened a Command Prompt or Terminal, and have activated the Python environment into which you want to install the packages. A simple way to activate a specific edm-installed environment at a command line is:

edm shell -e <environment-name>

Packages should be installed using edm whenever possible (i.e. whenever they are available in the Enthought package repositories).

edm install <package name>

If the package is not available in Enthought's package repositories, or you require a more recent version, then the following command will sometimes work:

pip install <package name>

Note that while the newly installed package can be imported (used) in your Python programs, it will not show in edm list (edm's list of installed packages). This list only includes the packages that edm itself installed in the environment.

Possible fragility of a pip install

If the "pip install <package name>" also installed any dependent packages which would have been available (though perhaps in a different version) from the Enthought package repository via edm, then it is possible that your environment would be corrupted because of conflict between the versions that pip installed and the version that is available from Enthought.

As a simple workaround, you can determine all the dependencies of your package in advance, and then install as many of these as possible via edm, before running pip. The easiest way to do this by creating and experimenting in a minimal throwaway edm environment. This solution does not, however, ensure the overall consistency of your Python environment.

To reduce the effort of such a trial-and-error approach, you may wish to learn in advance the dependencies of a particular Enthought-provided package. For this, use edm's list-dependencies command with its -r (recursive) option. The following forms are most commonly used, in order of increasing specificity:

edm list-dependencies -r <packagename>
edm list-dependencies -r <packagename^=version.number>
edm list-dependencies -r <packagename==version.number-buildnumber> 

Listing both edm-installed and externally-installed packages

To see a list of all the packages installed into the environment by normal means (whether edm, pip, or easy_install), you can type the following:

pip list

 

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.

Have more questions? Submit a request

Comments

Powered by Zendesk