Enthought Python Distribution (EPD) update via command line

Since the enpkg command doesn’t currently provide a good automatic way to update all your installed packages via command line, here’s a great way to update all the packages already installed in your Enthought Python Distribution (EPD) installation:

$epd_update

Run this command, after you have added this function code to your ~/.bash_profile, or in ~/.bashrc file:

function epd_update ()
{
    echo "[ Checking for epd package updates... ]"
    #-- display new packages
    sudo enpkg --whats-new
    #-- save new package list
    sudo enpkg --whats-new > /tmp/enpkgnew.txt
    #-- save only the first word after the "=====", it will be "no" if there are no new packages to be updated
    firstword=$(sed '1,2d' /tmp/enpkgnew.txt | awk 'NR>1{exit};1' | awk '{print $1}')
    if [ "$firstword" == "no" ]; then
        echo "[ No package updates available, exiting ]"
    else
        echo "[ Updating... ]"
        #-- space delimited list of the new packages
        newpacks=$(sed '1,2d' /tmp/enpkgnew.txt | awk '{print $1}' | tr "\n" " ")
        #-- update the new packages
        sudo enpkg $newpacks
    fi
}

It will either exit if there are no new packages, or will systematically install all new ones. Enjoy!

Installing odcctools on Leopard

Instructions for installing odcctools in Mac OS X 10.5 Leopard (on Intel Macbook Pro Core 2 Duo) via macports:

I was attempting to get matplotlib, the python plotting library, installed via macports and the first problem is that the library is dependent on odcctools (20061117_0), which fails to build in the x86_64 environment.

But, we can get it to build…:

1) (clean the slate)

$sudo port -v selfupdate;sudo portindex
$sudo port clean --all odcctools

2) (this part will fail)

$sudo port install odcctools

Output:

--->  Fetching odcctools
--->  Verifying checksum(s) for odcctools
--->  Extracting odcctools
--->  Configuring odcctools
--->  Building odcctools with target default
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_odcctools/work/odcctools/odcctools" && make default " returned error 2
Command output: cd libstuff && make
/usr/bin/gcc-4.0 -Wall -Wno-long-double -Wno-import  -DHAVE_CONFIG_H   -I/opt/local/include -I../include -I../include   -O2 -fno-builtin-round -fno-builtin-trunc -no-cpp-precomp -mdynamic-no-pic  -c -o allocate.o allocate.c
In file included from ../include/libkern/OSByteOrder.h:70,
from ../include/mach/ndr.h:94,
from ../include/mach/clock_priv.h:7,
from ../include/mach/mach_interface.h:37,
from ../include/mach/mach.h:62,
from allocate.c:26:
../include/libkern/machine/OSByteOrder.h:45: error: redefinition of '_OSSwapInt16'
/usr/include/libkern/i386/_OSByteOrder.h:49: error: previous definition of '_OSSwapInt16' was here
../include/libkern/machine/OSByteOrder.h:54: error: redefinition of '_OSSwapInt32'
/usr/include/libkern/i386/_OSByteOrder.h:58: error: previous definition of '_OSSwapInt32' was here
../include/libkern/machine/OSByteOrder.h:63: error: redefinition of '_OSSwapInt64'
/usr/include/libkern/i386/_OSByteOrder.h:69: error: previous definition of '_OSSwapInt64' was here
make[1]: *** [allocate.o] Error 1
make: *** [libstuff] Error 2
Error: Status 1 encountered during processing.

3)
(hint from http://code.google.com/p/iphone-dev/issues/detail?id=106#c1 )
From this path,
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_odcctools/work/odcctools/odcctools
in each subdirectory, look for a “Makefile”. IF the file has a “MYINCLUDES” line, add this after the equals ( = ) sign:
“-isysroot /Developer/SDKs/MacOSX10.4u.sdk” (w/o quotes). If the Makefile doesn’t contain a line which starts with MYINCLUDES, then ignore it.

e.g. This is how the line will look after putting in:

MYINCLUDES = -isysroot /Developer/SDKs/MacOSX10.4u.sdk -I$(builddir) -I$(srcdir) -I$(top_builddir)/include \
-I$(top_srcdir)/include $(INCPRIVEXT) $(FORHDRS)

4) (continue installation)

$sudo port install odcctools

Output:

--->  Building odcctools with target default
--->  Staging odcctools into destroot
--->  Installing odcctools 20061117_0
--->  Activating odcctools 20061117_0
--->  Cleaning odcctools

Done.

Next, I tried to continue the installation of matplotlib (e.g. sudo port install py25-matplotlib ), but <sigh> now g95 won’t compile…

[UPDATE 22 Sat, 2007: py25-matplotlib, including g25 now installs via Macports!!]

Newsyland blog starts!

Newsyland blog starts today.

Yes, the world is treated to yet another blog.  I have wanted to have a blog for some time now, to share, give back if you will, things I have learned – some internet wisdom and some of my own discoveries.  I spent some time looking at CMS software and wanted to do something based in Python since I’m learning it, but since my web provider (1and1.com) only supports version 2.2.1 (yes, a version over 4 years old, and yes I asked for a newer version but was shot down), I decided instead on the ubiquitous WordPress.

I’m an oceanographer in California, where I use Matlab and build websites, so will hopefully pass on nuggets of wisdom regarding Matlab, Javascript, PHP and CSS. I’m also a recent and enthusiastic Mac OS X convert, but dabble in Linux (Fedora) and am a Windows power user, so these subjects may come up. I’m also learning python and planning on taking some of the O’Reilly on-line classes, so will probably post some things about them too.

Oh, and “newsyland” is, I hope, a witty homophone to New Zealand – a place I’d love to live some day…

Filed under About