Alex Rivera | Logout

Using Enthought Python instead of the system Python

Asked 2012-01-25T19:16:13.397
9

I've installed the Enthought Python Distribution, which is basically a glorified Python distribution with added libraries for numerical and scientific computing. Now, since I use Debian, there is Python installed already. If I wish to use the Enthought Python for all work, how would I go about doing that?

Right now I am using a rudimentary alias like:

alias python='/usr/local/share/enthought/bin/python'

This is fine, but fails for shebang directives like #! /usr/bin/env python in independent Python scripts. So how do I get the system to use Enthought Python (without breaking anything of course!). Thanks!

Edit
Report

2 Answers

12

I think this is the official way of doing it, as recommended by Enthought:

export PATH=/usr/local/EPD/bin:$PATH

if you installed to /usr/local/EPD. Otherwise, the general form is

export PATH=/path/to/EPD/bin:$PATH 

This prepends the path to the EPD binary directory to your system PATH variable. The : is some sort of concatenate symbol. You can either run this in terminal every time, or you can put this in your ~/.bashrc file.


Critical Edit:

It turns out that EPD should actually be appended to the PATH, or you may have OS problems. Do it like this:

 export PATH=$PATH:/path/to/EPD/bin
answered 2012-06-14T18:47:15.013
1

Hmm I'm also encountering this problem. The first thing I did was the suggestion to prepend python to the path as suggested by Chad, but this results in some problems for other linux apps that use libraries that are not included in Enthought but are included in Linux Mint (or whatever distro you're using). In particular, if I load python from terminal, I successfully enter Enthought's version of python, but running "import pygtk" results in an error (because the library isn't installed in the Enthought version of python).

Does anyone know how to use PYTHONPATH to include first Enthought libraries, and then include the standard Linux libraries? This would be the optimal configuration....

answered 2013-01-03T05:22:23.777

Your Answer