Please instead see Amara1/Install


Tips for installing Amara on Ubuntu

You can choose to use the system-wide Python install, or build your own in your home directory. These tips cover both approaches.

Note: also tested on Fedora Core 7

Using the site-wide Python

This section has instructions for root and non-root users. Unfortunately, in either case, you may need some packages installed, so if you're non-root you may have to ask your sysadmin to do the following for you to set up for compiling Python extensions:

sudo apt-get install python-dev gcc libc6-dev

If the above is not an option, then you must use the full home directory install, so skip to that section.

If you will be installing Amara as root you can skip to "Install 4Suite and Amara".

If you want to install as a regular user, start by prepping your environment on the command line. For BASH users:

export PREFIX=$HOME/lib
export PYTHONPATH=$PREFIX/lib/python2.4/site-packages
export PATH=$HOME/bin:$PATH

The latter environment variable (PATH) is necessary in order to pick up scripts (associated with python packages) which are installed into $HOME/bin before instances of the same scripts elsewhere in your $PATH

Note: if you switch to a different terminal you will need to re-run these commands or you can add them permanently to your $HOME/.bashrc or $HOME/.bash_profile, so they persist

Then setup Python installer prefs, and create the library path. This will tell easy_install to install extensions in your home directory so that they're available to the site-wide Python:

echo -e "[easy_install]\nprefix=$PREFIX" > /tmp/pydistutils.cfg
echo -e "site_dirs=$PREFIX/lib/python\$py_version_short/site-packages" >> /tmp/pydistutils.cfg
echo -e "\n[install]\ninstall_lib=$PREFIX/lib/python\$py_version_short/site-packages" >> /tmp/pydistutils.cfg
echo -e "install_scripts=$HOME/bin" >> /tmp/pydistutils.cfg
mkdir -p $PREFIX/lib/python2.4/site-packages
cp /tmp/pydistutils.cfg $HOME/.pydistutils.cfg

Just use "2.5" rather than "2.4" if that's the Python version you're using.

Note: It appears that the Python2.5 packaged with OpenSuse 10.2 has a bug on loading Python extensions and will fail loading 4Suite. Until Suse releases a fix it is advised to compile your own Python as explained in the next section.

If you are installing Amara along with a 4Suite-XML egg from cheeseshop then you can skip to "Install 4Suite and Amara".

Installing Amara with 4Suite from CVS

This section is particularly relevant if you need to build Amara along with 4Suite-XML from CVS. For this scenario, you will need to install Amara via:

python setup.py install

Within a source tree (checked out from CVS or downloaded as a tarball).

You will need to:

  1. Comment out the install_requires entry for 4Suite-XML (in setup.py)

  2. Run python setup.py install

  3. Comment out 4Suite_XML-1*.egg from $HOME/lib/lib/python2.*/site-packages/easy-install.pth (with a leading '#') if there is such an entry

For a bit of insight on why the last step is relevant (from Charming Python: Hatch Python eggs with setuptools):

Now skip to "Install 4Suite and Amara"

Using full home directory install

Install tools needed to build Python:

sudo apt-get install gcc g++ libreadline-dev libbz2-dev libc6-dev

Then do the build. Just use "2.5" rather than "2.4" if that's the Python version you're using.

tar jxvf ~/dl/python/Python-2.4.4.tar.bz2
cd Python-2.4.4
./configure --prefix=$HOME/lib --enable-unicode=ucs4
make; make install

Note: on Debian Etch, trying to build Python 2.3.6, I found I needed a somewhat different

sudo aptitude install gcc g++ libreadline4-dev libbz2-dev libc6-dev libzzip-dev zlib1g-dev

I'm not sure which of the extra zip development libraries did the trick for allowing the build of the zlib module (needed by easy_install) .

Install 4Suite and Amara

Grab [ez_install http://peak.telecommunity.com/DevCenter/EasyInstall these simple instructions]:

wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

You may need to link $HOME/lib/bin/easy_install to a spot in your PATH. Then just one more step:

easy_install amara

And you're done. The remaining sections are optional notes.

Installing CVS versions

If you want to install the latest CVS version of Amara, follow these instructions.

cd ~/src
cvs -d:pserver:anonymous@cvs.4suite.org:/var/local/cvsroot login
cvs -d:pserver:anonymous@cvs.4suite.org:/var/local/cvsroot get -r XML1_0-maint 4Suite
cvs -d:pserver:anonymous@cvs.4suite.org:/var/local/cvsroot get Amara

cd 4Suite
python setup.py install
cd ../Amara
python setup.py install

A quick check

cd ~
python -c "import amara"
cd -

Sample setup recipes

Python 2.5.1 on Debian stable, as root

cd /root
wget http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tar.bz2
mkdir src; cd src
tar jxvf ../Python-2.5.1.tar.bz2; cd Python-2.5.1
./configure --enable-unicode=ucs4 #default prefix is /usr/local
make; make install
cd ..
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
easy_install virtualenv

Amara1/Ubuntu_Install_Tips (last edited 2010-12-03 17:53:25 by LuisMiguel)