Your issue may have to do with the version of gcc used with the
Enthought Python Distribution-- I had a similar problem.
The newest version of EPD (as of 12/13/09) is compiled under gcc 4.0,
while your version of gcc is likely 4.2 with Snow Leopard. You have
to downgrade your gcc version to match the version with which your EPD
was compiled in order to compile and install pygraphviz successfully.
To check which version of gcc your EPD used, just type "python" into
the command line in Terminal.
You may see something like this:
<<<
Python 2.5.4 |EPD 5.1.1| (r254:67916, Jul 20 2009, 15:41:21)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
As you can see from the second line of output, the gcc version with
which EPD was compiled is 4.0.1. If this is the case for you,
continue reading.
To check your version of gcc, after you quit out of the Python
interpreter, do:
$ gcc -v
The last line of output after this command will tell you the gcc
(compiler) version you're running.
To change the version of gcc you are using to 4.0, change the symlink
to gcc at the command line using:
$ sudo ln -sf /usr/bin/gcc-4.0 /usr/bin/gcc
(This may be different for you depending on the directory where you
have gcc installed. Just make sure your gcc version matches your
Python installation version. The command line will also ask you for
your password. Proffer it.)
Then navigate to your uppermost pygraphviz directory in Terminal (I
assume you have checked out the most recent version from the
Subversion repository, and that you know the location of the directory
where you have downloaded this version of pygraphviz, e.g. Downloads
or your default User home directory).
do this at the command line:
$ sudo python setup.py install
Hopefully, the installation will work this time. To test the
pygraphviz installation, go back to the Terminal and "cd .." out of
your pygraphviz download directory. Start the python interpreter
("python") and do:
>>> import pygraphviz
If no errors are thrown, congratulations. You have yourself some
pygraphviz.
You should change your gcc version back to 4.2 after you have
installed pygraphviz successfully, if indeed you had to change gcc to
version 4.0:
$ sudo ln -sf /usr/bin/gcc-4.2 /usr/bin/gcc
I hope I got the syntax correct. Please let me know if any commands
or suggestions are unclear.
Thanks, and hope this helps,
Adam