Installation woes: phantom Numpy version?

Hello everyone,

I've had a heck of a time trying to install matplotlib. I've tried
installing both from svn and from the pre-built 0.98.3 egg with no
success. Any tips would be appreciated.

My setup is:
Mac Pro PPC G5, OS X 10.5.4
Python 2.5.1 (Apple build)
Numpy 1.2.0.dev5615 -- ran svn update and rebuilt this morning
Scipy 0.7.0.dev4603 -- ran svn update and rebuilt this morning

1. Error with the SourceForge 0.98.3 egg for OS X:
$ easy_install matplotlib-0.98.3-py2.5-macosx-10.3.egg
[snip]
REQUIRED DEPENDENCIES
~ * numpy 1.1 or later is required; you have
~ * 1.0.5.dev4673
error: Setup script exited with 1

As far as I know, numpy 1.0.5.dev4673 was never installed on this
machine. Running python and checking numpy.__version__ gives the
version string listed above (1.2.etc.). I can't find any other versions
on the system, and I don't know where the egg would be finding this
phantom version.

2. Error building from svn checkout, following the instructions at
http://ipython.scipy.org/moin/MatplotlibOSXBuildNotes:

g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
- -bundle -undefined dynamic_lookup -arch ppc -arch i386
- -L/usr/local/src/mpl-build/libpng-1.2.29
- -L/usr/local/src/mpl-build/freetype-2.3.7 -arch ppc -arch i386
- -I/usr/local/src/mpl-build/libpng-1.2.29
- -I/usr/local/src/mpl-build/freetype-2.3.7/include
build/temp.macosx-10.3-fat-2.5/src/ft2font.o
build/temp.macosx-10.3-fat-2.5/src/mplutils.o
build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o
build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o
build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o
build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/usr/local/lib
- -lfreetype -lz -lz -lstdc++ -lm -o
build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so
- -Wl,-framework,CoreServices,-framework,ApplicationServices
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib, file
is not of required architecture for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file:
/var/folders/7h/7hHE3mwXHGCNGWujjUd1L++++U2/-Tmp-//ccS3ZBhp.out (No such
file or directory)
error: command 'g++' failed with exit status 1

~From this, it would seem that the build is attempting to use an external
libpng, despite the fact that I built it from source without a problem,
it's located in /usr/local/src/mpl-build/libpng-1.2.29, and:

$ echo $CFLAGS
- -arch ppc -arch i386 -I/usr/local/src/mpl-build/libpng-1.2.29
- -I/usr/local/src/mpl-build/freetype-2.3.7/include
$ echo $LDFLAGS
- -arch ppc -arch i386 -L/usr/local/src/mpl-build/libpng-1.2.29
- -L/usr/local/src/mpl-build/freetype-2.3.7

What am I missing?

Any help would be greatly appreciated...I've played with this all day
and made little progress.

Thanks!

- --
Richard Lawrence
Research Coordinator
Computational Memory Lab
rwl@...2121...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello everyone,

I've had a heck of a time trying to install matplotlib. I've tried
installing both from svn and from the pre-built 0.98.3 egg with no
success. Any tips would be appreciated.

My setup is:
Mac Pro PPC G5, OS X 10.5.4
Python 2.5.1 (Apple build)
Numpy 1.2.0.dev5615 -- ran svn update and rebuilt this morning
Scipy 0.7.0.dev4603 -- ran svn update and rebuilt this morning

1. Error with the SourceForge 0.98.3 egg for OS X:
$ easy_install matplotlib-0.98.3-py2.5-macosx-10.3.egg
[snip]
REQUIRED DEPENDENCIES
~ * numpy 1.1 or later is required; you have
~ * 1.0.5.dev4673
error: Setup script exited with 1

As far as I know, numpy 1.0.5.dev4673 was never installed on this
machine. Running python and checking numpy.__version__ gives the
version string listed above (1.2.etc.). I can't find any other versions
on the system, and I don't know where the egg would be finding this
phantom version.

Most likely there is another version of numpy on your system that easy
install is picking up (multiple versions of python perhaps?). You
might try to find them with

  > find / -name numpy -type d

- -lfreetype -lz -lz -lstdc++ -lm -o
build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so
- -Wl,-framework,CoreServices,-framework,ApplicationServices
ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libPng.dylib, file
is not of required architecture for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file:
/var/folders/7h/7hHE3mwXHGCNGWujjUd1L++++U2/-Tmp-//ccS3ZBhp.out (No such
file or directory)
error: command 'g++' failed with exit status 1

~From this, it would seem that the build is attempting to use an external
libpng, despite the fact that I built it from source without a problem,
it's located in /usr/local/src/mpl-build/libpng-1.2.29, and:

$ echo CFLAGS \- \-arch ppc \-arch i386 \-I/usr/local/src/mpl\-build/libpng\-1\.2\.29 \- \-I/usr/local/src/mpl\-build/freetype\-2\.3\.7/include echo $LDFLAGS
- -arch ppc -arch i386 -L/usr/local/src/mpl-build/libpng-1.2.29
- -L/usr/local/src/mpl-build/freetype-2.3.7

What am I missing?

Did you edit setupext.py to remove the basedir settings ans Charlie
recommended? Also, let's make sure that the files in your ld path are
there and of the right type? What does

  > file /usr/local/src/mpl-build/libpng-1.2.29/libpng*

return?

Any help would be greatly appreciated...I've played with this all day
and made little progress.

One other option is to try following the build instructions I posted
at http://ipython.scipy.org/moin/Py4Science/InstallationOSX

···

On Wed, Aug 6, 2008 at 5:02 PM, Richard Lawrence <rwl@...2121...> wrote:

John,

Thanks for your help.

Most likely there is another version of numpy on your system that easy
install is picking up (multiple versions of python perhaps?). You
might try to find them with

  > find / -name numpy -type d

Indeed, this did turn up another installation, and I am now searching
for a third, even older one. I wish I understood the layout of /Library
better...or that there was only a single site-packages directory for
each version of Python :slight_smile: Once I weed them all out, I will give the egg
another shot. I would still like to be able to build it from source,
though, so I can stay up to date.

Did you edit setupext.py to remove the basedir settings ans Charlie
recommended? Also, let's make sure that the files in your ld path are
there and of the right type? What does

  > file /usr/local/src/mpl-build/libpng-1.2.29/libpng*

return?

I did in fact edit setupext.py, and the 'darwin' key of basedir is set
to an empty list. The file command does report universal binaries for
libpng*; the relevant output lines are:

libpng-1.2.29/libpng.a: Mach-O universal binary with 2
architectures
libpng-1.2.29/libpng.a (for architecture i386): current ar archive
random library
libpng-1.2.29/libpng.a (for architecture ppc): current ar archive random
library

(There are similar messages for the various .o and .lo files.)

One other option is to try following the build instructions I posted
at http://ipython.scipy.org/moin/Py4Science/InstallationOSX

Actually, the reason I went with the "whole hog" method of compiling
libpng and freetype from source was that I was running into a similar
architecture error when I tried compiling against the freetype and
libpng in /usr/X11R6. Perhaps there is some deeper include path issue
that I can't see?

- --
Richard Lawrence
Research Coordinator
Computational Memory Lab
rwl@...2121...
215-746-0407

Apple distributed a version of numpy with the system python, and set up sys.path so that their stuff would be found before site-packages, so you may be getting Apple's version of numpy rather than the one you built and installed. (I'm not running 10.5, so I can't supply details)

There are ways to work around this -- a little googling should help you figure it out, but I recommend that you avoid the whole problem (and others) by installing python.org's build of 2.5.2, and go from there -- the binaries on the numpy site are built for that version.

-Chris

···

On Wed, Aug 6, 2008 at 5:02 PM, Richard Lawrence <rwl@...2121...> wrote:

My setup is:
Mac Pro PPC G5, OS X 10.5.4
Python 2.5.1 (Apple build)
Numpy 1.2.0.dev5615 -- ran svn update and rebuilt this morning

REQUIRED DEPENDENCIES
~ * numpy 1.1 or later is required; you have
~ * 1.0.5.dev4673

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...