Numpy v1.1.0 not compatible with pylab in matplotlib 0.9.1

[skathi:~/Work/myCode/pyS3M] tgrav% python
ActivePython 2.5.1.1 (ActiveState Software Inc.) based on
Python 2.5.1 (r251:54863, May 1 2007, 17:40:00)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.1.0'
>>> import pylab
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pylab.py", line 1, in <module>
     from matplotlib.pylab import *
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/pylab.py", line 206, in <module>
     from matplotlib.numerix import npyma as ma
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/numerix/__init__.py", line 166, in <module>
     __import__('ma', g, l)
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/numerix/ma/__init__.py", line 16, in <module>
     from numpy.core.ma import *
ImportError: No module named ma
>>> import matplotlib
>>> matplotlib.__version__
'0.91.1'

The latest release of matplotlib (0.91.2) should work with the latest
release of numpy (1.1.0). Please test that configuration.

Thanks,
JDH

···

On Wed, May 28, 2008 at 12:37 PM, Tommy Grav <grav@...451...> wrote:

[skathi:~/Work/myCode/pyS3M] tgrav% python
ActivePython 2.5.1.1 (ActiveState Software Inc.) based on
Python 2.5.1 (r251:54863, May 1 2007, 17:40:00)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.1.0'> >>> import matplotlib
>>> matplotlib.__version__
'0.91.1'

Tommy,

That's right. If you upgrade numpy you need to upgrade mpl to 0.91.2 or later.

Eric

Tommy Grav wrote:

···

[skathi:~/Work/myCode/pyS3M] tgrav% python
ActivePython 2.5.1.1 (ActiveState Software Inc.) based on
Python 2.5.1 (r251:54863, May 1 2007, 17:40:00)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.1.0'
>>> import pylab
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/pylab.py", line 1, in <module>
     from matplotlib.pylab import *
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/pylab.py", line 206, in <module>
     from matplotlib.numerix import npyma as ma
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/numerix/__init__.py", line 166, in <module>
     __import__('ma', g, l)
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib/numerix/ma/__init__.py", line 16, in <module>
     from numpy.core.ma import *
ImportError: No module named ma
>>> import matplotlib
>>> matplotlib.__version__
'0.91.1'

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

I am trying to build matplotlib from svn, but run into this error:

running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.macosx-10.3-fat-2.5/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/lib.macosx-10.3-fat-2.5/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -bundle -undefined dynamic_lookup 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 -L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lfreetype -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/libJPEG.dylib, file is not of required architecture for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/+9/+9BDgtoTFv4AaU0pWhEE4++++TI/-Tmp-//ccUnfmnm.out (No such file or directory)
error: command 'g++' failed with exit status 1
[skathi:~/Downloads/matplotlib-0.91.2] tgrav%

I am on a PPC running mac os x 10.5.2. How can I configure g++ to drop the -arch i386 flag,
or is there something else wrong here?

Cheers
   Tommy

···

On May 28, 2008, at 1:54 PM, Eric Firing wrote:

Tommy,

That's right. If you upgrade numpy you need to upgrade mpl to 0.91.2 or later.

Eric

Tommy Grav wrote:

Tommy,

That's right. If you upgrade numpy you need to upgrade mpl to 0.91.2 or later.

Eric

I am trying to build matplotlib from svn, but run into this error:

ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libJPEG.dylib, file is not of required architecture for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/+9/+9BDgtoTFv4AaU0pWhEE4+++ +TI/-Tmp-//ccUnfmnm.out (No such file or directory)
error: command 'g++' failed with exit status 1
[skathi:~/Downloads/matplotlib-0.91.2] tgrav%

I am on a PPC running mac os x 10.5.2. How can I configure g++ to drop the -arch i386 flag,
or is there something else wrong here?

Building on the Mac seems to be a nightmare. There are various emails and howto writeups (including one of John's) floating around, but I don't know that it has ever all been consolidated into one easy-to-find, easy-to-use set of instructions that will work for just about anyone.

Maybe someone can provide, or has provided, a universal binary of 0.91.2 built against numpy 1.1?

Eric

···

On May 28, 2008, at 1:54 PM, Eric Firing wrote:

I seemed to remember that I had similar problems with 0.91.1, but used
the super-scipy package to install it. Of course that package is now only
for intel macs :frowning:

Hopefully someone else can shed some light on the issue. I will play around
in the mean time and maybe I will stumble upon something :slight_smile:

Cheers
   Tommy

···

On May 28, 2008, at 2:21 PM, Eric Firing wrote:

Building on the Mac seems to be a nightmare. There are various emails
and howto writeups (including one of John's) floating around, but I
don't know that it has ever all been consolidated into one easy-to-find,
easy-to-use set of instructions that will work for just about anyone.

Maybe someone can provide, or has provided, a universal binary of 0.91.2
built against numpy 1.1?

Does it need to be built against numpy 1.1? I thought the 1.1 release
was binary compatible.
If it is, this egg should work:

http://downloads.sourceforge.net/matplotlib/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg?use_mirror=internap

JDH

···

On Wed, May 28, 2008 at 1:21 PM, Eric Firing <efiring@...202...> wrote:

Maybe someone can provide, or has provided, a universal binary of 0.91.2
built against numpy 1.1?

The problem with the egg is that it installs it in /Library/Python/2.5/site-packages. This is only valid
for the standard apple python version. But with

easy_install -d /Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg

I was able to get 0.91.2 on my system :slight_smile:

Thanks
   Tommy

···

On May 28, 2008, at 2:27 PM, John Hunter wrote:

On Wed, May 28, 2008 at 1:21 PM, Eric Firing <efiring@...202...> > wrote:

Maybe someone can provide, or has provided, a universal binary of 0.91.2
built against numpy 1.1?

Does it need to be built against numpy 1.1? I thought the 1.1 release
was binary compatible.
If it is, this egg should work:

http://downloads.sourceforge.net/matplotlib/matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg?use_mirror=internap

JDH

Tommy Grav wrote:

I
don't know that it has ever all been consolidated into one easy-to- find, easy-to-use set of instructions that will work for just about anyone.

no, it hasn't.

However, I think:

$ easy-install matplotlib

should work, at least with the python.org python2.5

Maybe someone can provide, or has provided, a universal binary of 0.91.2 built against numpy 1.1?

does it need to be "built against" numpy at all? I didn't think it was a build-time dependency -- that is, any MPL 0.91.2 should do, and you can drop a new numpy into it. I don't know if there is one yet, though...

I seemed to remember that I had similar problems with 0.91.1, but used
the super-scipy package to install it. Of course that package is now only for intel macs :frowning:

There was talk of making it Universal, but I don't know what came of that.

There are essentially two options:

1) built it just for yourself -- I think the instructions John H. posted are pretty easy to follow.

2) Built so that it is re-distributable, as part of a py2app *.app, for instance. In this case, you need to find or build the dependencies as Universal static libs, then make sure that those are linked when you build. You should also probably use the python.org build of python, rather than Apple's one. I don't know that there are easy instructions for this anywhere, but Russel Owen did post some somewhere a while back.

2b) built against the Universal Frameworks found here:

http://www.kyngchaos.com/wiki/software:frameworks
(I think FreeType and UnixImageIO should do it).

That will give you a Universal build that you can use with py2app, but if anyone else wants to use that build, they'll need to install those frameworks too.

-Chris

···

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

Christopher Barker wrote:

Tommy Grav wrote:

I
don't know that it has ever all been consolidated into one easy-to- find, easy-to-use set of instructions that will work for just about anyone.

no, it hasn't.

And one of the reasons may be that it is very complicated in practice, with all the possible variations of OSX versions, Xcode versions, processor architectures, and styles of build for python itself and various libraries. It seems to require learning a whole new jargon.

However, I think:

$ easy-install matplotlib

should work, at least with the python.org python2.5

Maybe someone can provide, or has provided, a universal binary of 0.91.2 built against numpy 1.1?

does it need to be "built against" numpy at all? I didn't think it was a build-time dependency -- that is, any MPL 0.91.2 should do, and you can drop a new numpy into it. I don't know if there is one yet, though...

_backend_gdk.c and nxutils.c both call into the numpy C API; maybe some c++ code does also. It is not entirely clear to me whether 1.1 is sufficiently binary-compatible that this is safe.

There are essentially two options:

1) built it just for yourself -- I think the instructions John H. posted are pretty easy to follow.

That's the way they look, but having watched someone try it, I can testify that looks are deceptive. I would say that with 95% probability, if Tommy tried to follow John's instructions, he would not succeed.

Eric

I've consistently been able to build matplotlib on OS X. Just make
sure you have all the dependencies installed. Personally, I have lbpng
and whatnot installed in /usr/local instead of /usr/X11. I don't know
if that'll help. Also, I use the GCC 4.2 that Apple has available for
download on developer.apple.com. Then you just change the Makefile in
the /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/
directory to not use Wno-long-double or no-cpp-precomp. I also took
out all the ppc arch flags since it was causing some issues there with
my versions of libpng and whatnot technically not being universal
binaries. If you don't want to build univeral binary versions of your
dependencies or use the ones alread provided in /usr/X11 (which are
universal I think), you should make Python only build for your
architecture, which is what I did.

My only issue with matplotlib thusfar seems to be the inability to do
the plot3d examples from the scipy website, but I'm told that stuff is
officially unsupported anyway.

Josh

···

On Wed, May 28, 2008 at 3:35 PM, Eric Firing <efiring@...202...> wrote:

Christopher Barker wrote:

Tommy Grav wrote:

I
don't know that it has ever all been consolidated into one easy-to-
find, easy-to-use set of instructions that will work for just about anyone.

no, it hasn't.

And one of the reasons may be that it is very complicated in practice,
with all the possible variations of OSX versions, Xcode versions,
processor architectures, and styles of build for python itself and
various libraries. It seems to require learning a whole new jargon.

However, I think:

$ easy-install matplotlib

should work, at least with the python.org python2.5

Maybe someone can provide, or has provided, a universal binary of
0.91.2 built against numpy 1.1?

does it need to be "built against" numpy at all? I didn't think it was a
build-time dependency -- that is, any MPL 0.91.2 should do, and you can
drop a new numpy into it. I don't know if there is one yet, though...

_backend_gdk.c and nxutils.c both call into the numpy C API; maybe some
c++ code does also. It is not entirely clear to me whether 1.1 is
sufficiently binary-compatible that this is safe.

There are essentially two options:

1) built it just for yourself -- I think the instructions John H. posted
are pretty easy to follow.

That's the way they look, but having watched someone try it, I can
testify that looks are deceptive. I would say that with 95%
probability, if Tommy tried to follow John's instructions, he would not
succeed.

Eric

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Eric Firing wrote:

_backend_gdk.c and nxutils.c both call into the numpy C API; maybe some
c++ code does also. It is not entirely clear to me whether 1.1 is sufficiently binary-compatible that this is safe.
  
The C API did not change (with the possible exception of additions). I'd be really surprised if this is an issue -- the numpy devs worked to make sure there would be no breakage at the C API level.

(And even if it did change, as it might one day in the future -- numpy 2? -- there's a check that happens at numpy load time, during import_array(), that checks whether the version of numpy you compiled with is the version you're loading now and raises an exception if it's not. So, the old nightmares of numeric and numarray possibly being run against binary incompatible versions are a thing of the past. This check actually saved quite a few headaches during the runup to numpy 1.0, when there were a number of C API changes happening in quick succession as Travis worked to get it right. That machinery is still in there.)