pewfly
pewfly

Reputation: 293

Using Enthought Python instead of the system Python

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!

Upvotes: 9

Views: 5766

Answers (6)

Wok
Wok

Reputation: 5333

I use aliases.

alias python=~/Softwares/EPD_7.3/epd-7.3-2-rh5-x86_64/bin/python
alias ipython=~/Softwares/EPD_7.3/epd-7.3-2-rh5-x86_64/bin/ipython

Upvotes: 0

Density 21.5
Density 21.5

Reputation: 1930

If your on Debian you could install enthought Python in virtualenv.

Enthought would have its own libraries without bothering other debian programs that need the system version. You could make switching easier between environments with virtualenvwrapper.

There is also a method with virtualenv to share (certain) site-packages among environments. Make sure to use pip instead of easy_install within a virtualenv.

Django people do it all the time.

Upvotes: 5

Chad
Chad

Reputation: 1530

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

Upvotes: 12

Adam
Adam

Reputation: 282

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....

Upvotes: 1

I think, that on Debian it is better to install packages like this:

apt-get install python-numpy python-numpy-doc python-scipy python-matplotlib ipython

instead of install Enthought Python Distribution.

Upvotes: 2

silent1mezzo
silent1mezzo

Reputation: 2942

Symlink the current version of python to the Enthought one.

ln -s /usr/bin/python[version]  /path/to/enthought/python

Upvotes: 2

Related Questions